Reputation: 807
For years our office has been using HP printers and a few Macros in MS Word that add buttons to the toolbar. One prints the job to tray 3 (plain paper), one prints the first page to tray 2 (pre-printed letterhead) and the rest to tray 3, and the last sends the whole job to tray 1 (manual feed for labels etc.).
This has all been pretty straight cut to tweak if the printer changed, but now we have replaced all of those HP printers with Canon printers and are using the UFRII drivers...
The macro sort of works, but not quite. The issue is that previously the tray assignments were set with the tray numbers eg.
Sub Letterhead()
'
' Prints the Letterhead copy of documents (First page LH, balance on Plain)
' Created By Reece on 24/01/2011
'
With ActiveDocument.PageSetup
.FirstPageTray = 263
.OtherPagesTray = 262
End With
Application.PrintOut , Range:=wdPrintAllDocument
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
End With
End Sub
but now the tray assignments are using what I've got below:
Sub Letterhead()
'
' Prints the Letterhead copy of documents (First page LH, balance on Plain)
' Created By Reece on 08/05/2013
'
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterUpperBin
.OtherPagesTray = wdPrinterMiddleBin
End With
Application.PrintOut , Range:=wdPrintAllDocument
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
End With
End Sub
Usually, all I'd have to do to find out the new printer's tray numbers is record the macro by running through the procedue (page layout > change trays > print > change trays back) and taking note of the numbers... but I'm not getting numbers with the new printers.
Can anyone help find what the tray assignment numbers are for Canon LBP6680's?
Upvotes: 1
Views: 8020
Reputation: 341
The particular tray numbers depend on the printer driver and the printer manufacturer. There is a commercial product that we have used called Tray Selector. Their site is www.trayselector.com. Its not very expensive and I suggest you check it out. We used to use a macro based solution in our law firm until we discovered this small .Net addin which is relatively inexpensive compared to what we now save in wasted paper and toner.
If you really want to find out the tray numbers for particular printers you can even install this product then look in the registry under HKCU/Sofware/TraySelector/Profiles and you'll see what the tray numbers are for the different trays. You can then use the code above.
Hope that helps
Upvotes: 0
Reputation: 11
Don't worry, these are Visual Basic constants, which actually are numbers as well. You don't have to buy some commercial product.
In Word, use the Alt-F11 key combo to open the VBA editor. In the editor, use F2 to open Objectenoverzicht (I have a Dutch version of Word, maybe this is called "Object view" or something). Near the top in the right pane are two drop down list boxes. Type one of the constants, say wdPrinterUpperBin, in the lower box and hit the button with the binocular. A pane opens on the right below that lists all possible terms. When you select one of these, the corresponding number is given in a section below the pane.
Kind regards,
Coos
Upvotes: 1