这似乎是一个简单的需求,但由于某种原因我找不到如何实现这一点。我有这样的代码:
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
MemoryStream documentStream = getDocStream();
FileInfo wordFile = new FileInfo("c:\\test.docx");
object fileObject = wordFile.FullName;
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = wordInstance.Documents.Open(ref fileObject, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
doc.Activate();
doc.PrintOut(oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);
我需要一个配置设置驱动器来使用打印机和托盘。搜索后,我发现 Microsoft.Office.Interop.Word.Application.ActivePrinter 这是一个可设置的字符串属性,文档说它采用“活动打印机的名称”,但我不知道这对于打印机来说意味着什么“活动打印机”,尤其是当我有两个时。如何才能做到这一点?