由网友(命中不缺狗)分享简介:我如何可以启动从C#.NET应用程序文档的打印?在Word文档已经存在于硬盘驱动器。我只想开始打印在按钮点击事件的Word文档。解决方案 的ProcessStartInfo磅=新的ProcessStartInfo(wordFilename){UseShellExecute = TRUE,动词=打印,Redirec...
我如何可以启动从C#.NET应用程序文档的打印? 在Word文档已经存在于硬盘驱动器。我只想开始打印在按钮点击事件的Word文档。
解决方案 的ProcessStartInfo磅=新的ProcessStartInfo(wordFilename)
{
UseShellExecute = TRUE,
动词=打印,
RedirectStandardOutput =假,
CreateNoWindow =真
};
使用(进程p =新的Process {StartInfo的= PSI})
{
p.Start();
p.WaitForExit();
}
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 button click event.
解决方案 ProcessStartInfo psi = new ProcessStartInfo(wordFilename)
{
UseShellExecute = true,
Verb = "print",
RedirectStandardOutput = false,
CreateNoWindow = true
};
using (Process p = new Process {StartInfo = psi})
{
p.Start();
p.WaitForExit();
}
相关推荐
最新文章