Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

manual duplex printing in Word/NT

Status
Not open for further replies.

kinggz

Programmer
Oct 8, 1998
2
US
I'm trying to save trees and filing space by printing long documents double sided on a network printer. I do this by printing all the even pages only first, then printing all the odd pages having put the even pages in the paper tray. To enable me to put the even pages in the paper tray I select Tray 1- manual from the printers properties dialog box within the print dialog box in Word.

So I would like to write a macro which
(1) prints the even pages only - easy
(2) sets the printer settings to Tray 1 - manual - HELP!
(3) prints the odd pages only - easy
(4) resets the printer settings to default tray - HELP

while I can easily accomplish (1) and (3), I can't figure out a way to access the printer properties within VBA code.

I've thought about creating another printer whose paper setting is manual and then using ActivePrinter to change between the two. But I'm on a tightly controlled NT network where I can't touch the printer settings (fair enough) or even set up a local printer driver. So I think I really do need some way of accessing those printer properties (or just the default paper source one). I've found some info on MS site for doing that in Access (not an app I'm very familiar with) using PrtDevMode but that doesn't exist in Word. There's a manualduplexprint property of the printout method in word but despite the hopeful title it doesn't sound from the help file that it's quite the right thing and in any event it's not available on a US English installation of Word.

Please help!
 
Hi, see this example to manage the printers tray, read the notes. You can modify this function in order to get what you whant.


Function TwoTrayPrinting(ReportName As String) As Integer
'
' Prints a report's page 1 from the upper tray
' and the remaining pages from the lower tray.
' NOTE: The report gets run twice, once for each tray.
'
' Assumes: that the report has 999 or fewer pages.
'
' Returns: TRUE = Success; FALSE = Error
'
Const MAX_PAGES = 999

' Open the report in DESIGN view
On Error GoTo TTP_Error
DoCmd.Echo False
DoCmd.OpenReport ReportName, A_DESIGN

' Switch to upper tray and print first page
SetReportTray Reports(ReportName), R_UPPER_TRAY
DoCmd.PrintOut A_PAGES, 1, 1

' Switch to lower tray and print remaining pages
SetReportTray Reports(ReportName), R_LOWER_TRAY
DoCmd.PrintOut A_PAGES, 2, MAX_PAGES

' Close the report
DoCmd.SetWarnings False
DoCmd.Close A_REPORT, ReportName
DoCmd.SetWarnings True
DoCmd.Echo True
'TwoTrayPrinting = True

TTP_Exit:
Exit Function

TTP_Error:
' TwoTrayPrinting = False
DoCmd.Echo False ' Restore screen echo
Resume TTP_Exit

End Function


Best Regards

---
JoaoTL
NOSPAM_mail@jtl.co.pt
 
JoaoTL

Thanks for the post but unless I've misunderstood it, your function is for use in Access. I want to control the paper trays from Word97 and I can't use statements like DoCmd or SetReportTrays.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top