Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Duplex Printing In Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric L. - 17 Aug 2005 14:55 GMT
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
dave.cuthill@computalog.com - 17 Aug 2005 19:09 GMT
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
Eric L. - 17 Aug 2005 20:33 GMT
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

> This is what I found on my search ... you seemed to have made some
> changes that only allow the first page to be printed.
[quoted text clipped - 10 lines]
>     End If
> End Sub
dave.cuthill@computalog.com - 17 Aug 2005 22:12 GMT
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.
Eric L. - 18 Aug 2005 20:05 GMT
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.

> 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
[quoted text clipped - 5 lines]
> To:="1" to guarantee that the first page is printed regardless of where
> you are at the time of running the macro.
dave.cuthill@computalog.com - 18 Aug 2005 20:39 GMT
Works fine for me - maybe it's related to your printer. Why not try
another printer or mess around for the printer setup.

David
Eric L. - 18 Aug 2005 20:43 GMT
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

> 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
[quoted text clipped - 5 lines]
> To:="1" to guarantee that the first page is printed regardless of where
> you are at the time of running the macro.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.