none
Duplex printing from Word add-in RRS feed

  • Question

  • I have VB.Net Word add-in from which I want to print some Word document in duplex mode on a printer that can duplex print. However, it depends on the document if it has to be printed duplex or not. I already read the following article: http://support.microsoft.com/kb/230743/en-us

    I implemented the code in the article and it works in a way: I can switch the printer to duplex (if the user has enough access rights) and then back to simplex. However, this seems to be a global printer setting and not a setting per print job. Therefore if I start three print jobs in a row with 1st = simplex, 2nd = duplex, 3rd = simplex then the second print job is printed simplex, too, because the printer was switched back to simplex for the 3rd job.

    If I print interactively from Word (without code) then Word seems to set a 'duplex flag' in the print job. So every print job knows if it has to print duplex or simplex.

    Is there a way (maybe through WinAPI calls) to achieve this same functionality?

    Thanks for any ideas
    Guido

    Thursday, January 10, 2013 10:09 AM

Answers

  • I found an interesting article about System.Printing.PrintQueue: http://msdn.microsoft.com/en-us/library/ms552920.aspx

    The sample code changes the UserPrintTicket to print duplex. The problem is: If I change the duplex setting while Word is open then Word won't refresh its printer settings and still prints simplex. Now I have to tell Word to refresh the printer settings and everything would be fine...


    Thursday, January 10, 2013 11:57 AM

All replies

  • I found an interesting article about System.Printing.PrintQueue: http://msdn.microsoft.com/en-us/library/ms552920.aspx

    The sample code changes the UserPrintTicket to print duplex. The problem is: If I change the duplex setting while Word is open then Word won't refresh its printer settings and still prints simplex. Now I have to tell Word to refresh the printer settings and everything would be fine...


    Thursday, January 10, 2013 11:57 AM
  • Hi Guido,

    I'm glad to hear that you have solved this issue by yourself. Thanks for sharing your experience here, it's really beneficial for other community members who have similar problem to see how your solved it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 11, 2013 1:19 AM
    Moderator