How to print a Word document from C#

后端 未结 2 938
野性不改
野性不改 2021-01-28 21:03

How can I launch the print of a document from C# .NET application ? the Word document already exists in the hard drive. I just wish to start printing that Word document upon the

2条回答
  •  天涯浪人
    2021-01-28 21:50

     ProcessStartInfo psi = new ProcessStartInfo(wordFilename)
     {
        UseShellExecute = true,
        Verb = "print",
        RedirectStandardOutput = false,
        CreateNoWindow = true
     };
    
     using (Process p = new Process {StartInfo = psi})
     {
         p.Start();
         p.WaitForExit();
     }
    

提交回复
热议问题