Duplex Printing In Word

E

Eric L.

Greetings,

I found a macro that is suppose to manually print duplex for printers that
don't have the duplex option. The code is suppose to print the current page
in the active document, open a messagebox so the user can manually flip the
page, and then print the second (or even) page after the user presses ok. The
macro does print, but only after the code finishes running. For some reason,
it only spools the the first print current page command, and then prints it
when the code finishes running.
Any help would be great! Thank you!

Here's the code:

Sub PrintBothSides()
'
' PrintBothSides Macro
'
Dim iTemp As Integer

ActiveDocument.PrintOut (ManualDuplexPrint), Copies:=1,
Range:=wdPrintCurrentPage
iTemp = MsgBox("Switch paper to continue", vbOKCancel, "PrintBothSides")
If iTemp = vbOK Then
ActiveDocument.PrintOut Copies:=1, PageType:=wdPrintEvenPagesOnly
End If

End Sub
 
D

dave.cuthill

This is what I found on my search ... you seemed to have made some
changes that only allow the first page to be printed.


Sub PrintBothSides()
Dim iTemp As Integer

ActiveDocument.PrintOut Copies:=1, PageType:=wdPrintOddPagesOnly
iTemp = MsgBox("Switch paper to continue", vbOKCancel,
"PrintBothSides")
If iTemp = vbOK Then
ActiveDocument.PrintOut Copies:=1,
PageType:=wdPrintEvenPagesOnly
End If
End Sub
 
E

Eric L.

Hi Dave,

You're right, I did change the code to print the first page only....at
first. Once the message box appears, and the user chooses "Ok", then the even
pages are printed. I only want the first and second page printed, with a
break in between to allow for time to flip the page.

I will add that the code works fine when I debug, but at runtime, it sends
the document (page 1) to the printer queue and spools. Then after I click ok,
it will send the second document (page 2) to the printer queue, and will
start printing the first document (Page 1), folowed immediately by page 2.
It's very strange, but I imagine it has something to do with the code.

Thanks for your help Dave.

~Eric
 
D

dave.cuthill

I took out the manualduplexprint and it now seems to do what you are
wanting. But I think you need to be on the first page of the document
when you run the macro.

ActiveDocument.PrintOut Copies:=1, Range:=wdPrintCurrentPage

I wonder whether you should use Range:=wdPrintFromTo, From:="1",
To:="1" to guarantee that the first page is printed regardless of where
you are at the time of running the macro.
 
E

Eric L.

I tried it exactly the way you suggested, and it still spools page one
instead of printing it. It'll only print AFTER you click OK. Very puzziing
problem.
 
D

dave.cuthill

Works fine for me - maybe it's related to your printer. Why not try
another printer or mess around for the printer setup.

David
 
E

Eric L.

Dave,

Thanks for all your help! This code ended up working:
Sub PrintBothSides()
'
' PrintBothSides Macro
' Allows manual duplex printing

' Prints page 1, tells user to flip the page over, and then prints page 2
ActiveDocument.PrintOut ManualDuplexPrint:=True, Range:=wdPrintFromTo,
From:="1", To:="2"

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top