更新时间:2023-10-19 22:04:04
在检查了库之后,您要做的就是使用SetActivePrinter
方法更改默认打印机,如下所示:
After Checking the library all you have to do is using SetActivePrinter
Method to change your default printer like the following:
AxEDOffice1.SetActivePrinter("Adobe PDF")
要更改PaperSize,您必须使用以下内容
And to change PaperSize you have to use the following
AxEDOffice1.ActiveDocument.PageSetup.PaperSize = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA4
AxEDOffice1.ActiveDocument
是Microsoft.Office.Interop.Word.WordDocumentClass
代码对其进行了测试,并且效果很好.
Code tested it and it works fine.
对象变量或未设置带块变量
Object variable or With block variable not set
在此
要直接打印文档而不显示PrintDialog
,必须使用PrintOut
功能.
To Print your document directly without showing PrintDialog
you have to use PrintOut
Function.
AxEDOffice1.PrintOut(EDOfficeLib.WdPrintOutRange.wdPrintAllDocument)