Hi Jennifer. Hi "old man"
Just to add a little to "old man"'s replies ...
Unfortunately, tray IDs can vary from printer to printer (or printer driver
to printer driver). Some drivers seem to use the values "old man" referred to
(the built-in constants such as wdPrinterUpperBin), but some use other values
such as 259.
One way you can tell what IDs are actually in use is to ensure that the
relevant printer is selected in Word, turn on the macro recorder, go into
page setup and select the trays you're interested in. Then stop the recorder
and have a look at the values it recorded.
I've never actually used the paper types listed in the page setup dialog as
"Letterhead" and "Bond" and so on; the way we do it is that we know that
letterhead stationery is in tray one so we find the ID of tray one and use
that for letterhead, and do the same sort of thing for other paper types. I
don't know if this makes a difference.
Regarding your other query, the PageSetup object exists at the level of the
ActiveDocument but also on a section-by-section basis so you can
programmatically control the trays used by different sections of a document.
For example:
With ActiveDocument.Sections(1).PageSetup
.FirstPageTray=wdPrinterUpperBin
.OtherPagesTray=wdPrinterLowerBin
End With
With ActiveDocument.Sections(2).PageSetup
.FirstPageTray=wdPrinterLargeCapacityBin
.OtherPagesTray=wdPrinterLargeCapacityBin
End With
If you have two sections which part-share a page, e.g. a three page document
with a continuous section break on page one and you set section one to go to
tray X and section two to go to tray Y, when I tested this scenario (quite a
while ago) I believe the way that Word handled it was to print page one from
tray X and the other pages from tray Y. (Which was lucky because that's what
I needed
).
Hope this helps.
Regards.
Ed