-
[VBA]
For pagenum = 0 To 19
Select Case pagenum
Case 0 ' page 20 is a separator page legal size in tray 1
ActivePrinter = "HP2430 tr1 ss"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="20", PageType:=wdPrintAllPages, _
Collate:=True, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
Case 1 To 3 ' regular single sided from tray 3
ActivePrinter = "HP2430 tr3 ss"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:=Str(pagenum), PageType:= _
wdPrintAllPages, Collate:=True, Background:=False, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
Case 4 ' (prints 4 & 5) two duplex printed pages from tray 2 (NCR paper)
ActivePrinter = "HP2430 tr2 dup"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, _
Pages:=Str(pagenum) + "," + Str(pagenum + 1) + "," + Str(pagenum) + "," + Str(pagenum + 1), _
PageType:=wdPrintAllPages, Collate:=True, Background:=False, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
Case 6 To 13 ' need 2 copies of these pages from tray 2 (NCR paper)
ActivePrinter = "HP2430 tr2 ss"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:=Str(pagenum) + "," + Str(pagenum), _
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
Case 14 To 18 ' regular single sided from tray 3
ActivePrinter = "HP2430 tr3 ss"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:=Str(pagenum), PageType:= _
wdPrintAllPages, Collate:=True, Background:=False, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Select
Next pagenum
[/VBA]
You can see that I have many instances of the same printer which allows me to select trays and duplex. If I go through this code a second time to soon, then I start to get things out of sequence, for example the legal size seperator sheets might come both together at the end, or any other possible shuffle. What happens (I think) is that each of these 3 instances has its own queue and each of my "printout" calls to print is in effect a separate job.
What I have done is set "print direct to printer" on the defaults of each "instance" to avoid a queue, which works but I start getting errors before getting 2 copies out (which I assume is because the printer memory is full - I have upgrade to max in the mail).
My ultimate goal is to print 3 or 4 copies of my document at a time - enough to fill the output tray. Any advice on achieving that end will be appreciated.
Doug
PS - By the way I always have copies=1 because when I set the "printing preferences" I have somehow forced an override of copies=1 anyway - but that is another story and something that I am sure I can rectify by creating a fresh install.
PPS - I have printed test documents "to file" and taken a look at the PJL and PCL (limited grasp of it all) with the hope that I can get the settings I want but send all the files to the same printer instance and thus to the same queue. Just begun this line of experiment!)
Last edited by Old Doug; 04-24-2005 at 07:50 PM.
Reason: missing word make its meaning unclear
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules