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

Re: Duplex Printing In Word by dave

dave
Wed Aug 17 13:09:30 CDT 2005

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


Re: Duplex Printing In Word by EricL

EricL
Wed Aug 17 14:33:08 CDT 2005

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

"dave.cuthill@computalog.com" wrote:

> 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
>
>

Re: Duplex Printing In Word by dave

dave
Wed Aug 17 16:12:44 CDT 2005

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.


Re: Duplex Printing In Word by EricL

EricL
Thu Aug 18 14:05:15 CDT 2005

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.

"dave.cuthill@computalog.com" wrote:

> 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.
>
>

Re: Duplex Printing In Word by dave

dave
Thu Aug 18 14:39:03 CDT 2005

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

David


Re: Duplex Printing In Word by EricL

EricL
Thu Aug 18 14:43:15 CDT 2005

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

"dave.cuthill@computalog.com" wrote:

> 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.
>
>