Reset print options 
Author Message
 Reset print options

I need to use this code printing some documents:

    Options.PrintEvenPagesInAscendingOrder = True
    Options.PrintOddPagesInAscendingOrder = False
    ActiveDocument.PrintOut ManualDuplexPrint:=True

Everything is perfect, but i don't know how to reset the printer after this
manual duplex printing.
Any ideas?



Fri, 02 Dec 2005 21:00:11 GMT  
 Reset print options
Hi, Nunzia,

You need to save the user's existing settings into variables before you
change them, and then put those values back after the printing is done. Do
it this way:

    Dim oldEven As Boolean, oldOdd As Boolean

    oldEven = Options.PrintEvenPagesInAscendingOrder
    oldOdd = Options.PrintOddPagesInAscendingOrder

    Options.PrintEvenPagesInAscendingOrder = True
    Options.PrintOddPagesInAscendingOrder = False
    ActiveDocument.PrintOut ManualDuplexPrint:=True, _
        Background:=False

    Options.PrintEvenPagesInAscendingOrder = oldEven
    Options.PrintOddPagesInAscendingOrder = oldOdd

When the Background parameter of .PrintOut is False, the macro waits for
printing to finish before executing the next line.

--
Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://www.mvps.org/word

Quote:

> I need to use this code printing some documents:

>     Options.PrintEvenPagesInAscendingOrder = True
>     Options.PrintOddPagesInAscendingOrder = False
>     ActiveDocument.PrintOut ManualDuplexPrint:=True

> Everything is perfect, but i don't know how to reset the printer
> after this manual duplex printing.
> Any ideas?



Fri, 02 Dec 2005 23:58:45 GMT  
 Reset print options
Hi Jay,
thank you for your reply.
You solution works great for odd and even pages, but it doesn't reset the
ManualDuplexPrinter setting.
Do you have any suggestion?


Sun, 04 Dec 2005 20:51:05 GMT  
 Reset print options
Hi, Nunzia,

The ManualDuplexPrinter setting isn't a member of the Options object the way the
Even and Odd properties are, so you can't reset it the same way. The trick is
explained at http://www.mvps.org/word/FAQs/MacrosVBA/ResetPrintToFile.htm -- you
"print" the nonexistent page 0 to change the value. Here's the complete code:

Sub PrintManualDuplex()
    Dim oldEven As Boolean, oldOdd As Boolean

    oldEven = Options.PrintEvenPagesInAscendingOrder
    oldOdd = Options.PrintOddPagesInAscendingOrder

    Options.PrintEvenPagesInAscendingOrder = True
    Options.PrintOddPagesInAscendingOrder = False
    ActiveDocument.PrintOut ManualDuplexPrint:=True, _
        Background:=False

    Options.PrintEvenPagesInAscendingOrder = oldEven
    Options.PrintOddPagesInAscendingOrder = oldOdd
    Application.PrintOut ManualDuplexPrint:=False, _
        Range:=wdPrintRangeOfPages, Pages:="0"
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP        Word MVP FAQ site: http://www.mvps.org/word

Quote:

> Hi Jay,
> thank you for your reply.
> You solution works great for odd and even pages, but it doesn't reset
> the ManualDuplexPrinter setting.
> Do you have any suggestion?



Mon, 05 Dec 2005 09:05:15 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Code to reset database startup options

2. VBA to reset Options

3. Reset Options in Outook 2000

4. VB Net Text Editor Options reset

5. reset Toggle btn in Option Grp when, Next Record

6. Reset without resetting

7. How to reset Print To File to false

8. Reset WindowParentHandle to rpt will print to printer?

9. number of print copies does not reset to 1

10. HELP: Reset Print.TextWidth from Integer to Single

11. How do I reset Default printer after ComDlg Print Box resets...

12. "Printing Pages Option Missing"

 

 
Powered by phpBB® Forum Software