Free Support Forum - aspose.com

Print Word Document without Print Preview

Hi,

I am using Aspose words component for .NET to generate a bunch (50,000) of DOCX files from a mail merge template and saving them in a directory.

I need to print them automatically (all of them at once or one at time in a for loop) without showing the print preview dialog for them.

How can I achieve this? So far all the code I have seen shows printing them using print preview dialog.

Thanks,

Tim

Hi Tim,


Thanks for your inquiry. Please use Document.Print method for your requirement. This method print the whole document to the specified printer, using the standard (no User Interface) print controller.

<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;color:#2B91AF;mso-font-kerning:
0pt;mso-no-proof:yes”>Document<span lang=“EN-GB” style=“font-size:10.0pt;
font-family:“Courier New”;mso-font-kerning:0pt;mso-no-proof:yes”> doc = new Document(MyDir

  • “Document.doc”);<o:p></o:p>

doc.Print();


Please read following documentation links for your kind reference.
http://www.aspose.com/docs/display/wordsnet/Print+Overload_1
http://www.aspose.com/docs/display/wordsnet/Print+Overload_2
http://www.aspose.com/docs/display/wordsnet/Print+Overload_3