简体   繁体   中英

How to print a Word.Document on both sides in C#?

Quick summary

I am able to print out a Word document in C# using PrintOut() function like so:

        object missing = Type.Missing;
        Word.Application app = new Word.Application();
        Word.Document doc = null;
        object template = @"/path/Template.docx";
        doc = app.Documents.Open(template, ReadOnly: true);
        app.Visible = false;

        // Print here
        doc.PrintOut();

Problem

What I realized is I can't print the document on both pages, if there are 2 pages. The 2 pages print 2 sheets, instead of printing on both sides.

I had a look here: https://docs.microsoft.com/en-us/office/vba/api/Word.Document.PrintOut nowhere it says anything about Printing on Both sides.

Question

What is a good method to print a Word.Document in C# on both sides of paper?

It should be a setting you can change in the physical printer if that doesn't work try calling the PrintOut() method of Microsoft.Office.Interop.Word.Document object with ManualDuplexPrint parameter set to true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM