Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jun 2005
    Thanked 0 Times in 0 Posts

    Printing single/double sided (WordXP)

    Most people have set their printer to print double sided.
    I am trying to write a macro to print single sided, but put the printer back to double sided (if it was set that way).
    The following code (written by someone else) prints as single sided:

    Public Sub s_PrintSingleSide()
    ' to change printing properties from long-side duplex printing to none

    If Windows.count = 0 Then End
    SendKeys "%P"
    SendKeys "%N"
    SendKeys "{ENTER}"
    SendKeys "%A"

    End Sub

    I don't understand how this works, or how to change the printing back to double sided. Can anyone help?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: Printing single/double sided (WordXP)

    SendKeys emulates you pressing those keys at the keyboard. I believe the % character means "Alt" but I'd have to check the help for SendKeys to be sure. Anyway, by looking at the underlined "accelerator key" shortcuts in the dialogs that are manipulated by the above macro, you should be able to work out how to set single-sided/double-sided setting the other way.

    Of course, I must add that SendKeys is not always reliable because it depends on the timing working out just so, and the menus and dialogs being in the right place at the right time. In this case, the keys are being sent to the print dialog, but if there is a delay in opening the dialog, some or all of the keystrokes might get lost...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts