Reputation: 7979
I print documents (batch print) using Word.Document.PrintOut
method. How can I print a document on both sides?
In the MS Word interface it can be done through the File->Print->Print on Both Sides option.
Word 2010, C#, .NET 3.5
Many thanks to John for his answer (+1)! There are results of my research:
After the failure of the DocumentProperties API I tried to put the print commands and got the following results:
So my investigation continues and if anyone have other ideas - welcome!
Upvotes: 5
Views: 3907
Reputation: 7979
The problem can not been solved directly, but it is possible to implement a workaround.
One "physical" printer should be installed on the client system several times, so that in the printers list it should be listed twice under different names.
Further, one of these "printers" must be configured to double side printing, and second to normal - one side printing. Depending on the application needs it selects one of two "printers" for printing documents.
Upvotes: 2
Reputation: 38077
There is a Microsoft KB Article on HOWTO: Set Duplex Printing for Word Automation, unfortunately it is not a simple property you set. It is VB code, but it should be pretty easy to convert to C#.
If you know you are using a PCL compatible printer, you can use print commands inside the document to force it to be duplex. This is really helpful when you need to switch between simplex and duplex mid document. You can add a field to the header of the document and then use 27"&l1S" or 27"&l2S" for duplex long and duplex short respectively. A full list of PCL print commands are available from a Microsoft KB article.
Upvotes: 2
Reputation: 3678
Call the PrintOut() method of the Microsoft.Office.Interop.Word.Document object with ManualDuplexPrint parameter set to true.
Upvotes: 0