我想以编程方式更改双面打印设置。但是花了将近一周的时间,我仍然没有找到解决方案。
目前,我只想要单面打印(相对于默认的双面打印设置)。
我尝试了几乎所有的解决方案。我的测试片段如下:
Word.Application wordapplication = new Word.Application
{
Visible = false
};
Word.Document wordDocument = wordapplication.Documents.Add(filePathWithName);
wordapplication.ActivePrinter = printer;
Range range = wordapplication.ActiveDocument.Range(
wordapplication.ActiveDocument.Content.Start,
wordapplication.ActiveDocument.Content.End);
//wordapplication.ActiveDocument.Fields.Add(range, WdFieldType.wdFieldPrint, "&l0S", false); //This also didn't work, people says it works for PCL5 only
wordapplication.ActiveDocument.PrintOut(); ///ManualDuplexPrint: false also didn't work
wordDocument.Close(SaveChanges: false);
wordDocument = null;
// Make sure all of the documents are gone from the queue
while (wordapplication.BackgroundPrintingStatus > 0)
{
System.Threading.Thread.Sleep(250);
}
wordapplication.Quit(SaveChanges: false);
wordapplication = null;
https://stackoverflow.com/questions/51352898
复制相似问题