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:
- I went to the first path that John recommends, found a few additional
articles, like “classic” article on CodeProject (Changing printer
settings using C#) and several others derived from it. In the end, I
got compiled code which was to set a Duplex property, but like many
others “victims” of this article – this code did not work 🙂 -
After the failure of the DocumentProperties API I tried to put the
print commands and got the following results:- My office printer (Kyocera FS-C5100) successfully printed a document
on both sides, BUT came crazy and began to print each paragraph on a
separate sheet… - Clients printer (Xerox 3600) apparently was “not fully HP-compatible” and did not print on both sides at all!
- My office printer (Kyocera FS-C5100) successfully printed a document
So my investigation continues and if anyone have other ideas – welcome!
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.