S
scott
hi
I have used Office XP VBA to automated some of our company contract
documents. one of the final steps to the process was making the documents
print to the manual tray 1 of the given printers.
the following snip of code was what I tried first
<snip>
'create contract
Set wdContract = Documents.Add(Template:="G:\contract\docs\contract.dot",
NewTemplate:=False, DocumentType:=0)
'force to print from manual feed tray
wdContract.PageSetup.FirstPageTray = wdPrinterManualFeed
wdContract.PageSetup.OtherPagesTray = wdPrinterManualFeed
</snip>
this was derived from the inline suggestion that the IDE makes ! but upon
running the code, it seemed to ignore this instruction, but no errors were
thrown up.
I then created a new blank doc and used the macro recorder and obtained the
following
<snip>
wdContract.PageSetup.FirstPageTray = 257
wdContract.PageSetup.OtherPagesTray = 257
</snip>
this seems to work completely as expected ! I'm not looking a gift horse
.....etc. etc. etc., but can anyone shed light as to
a) why the first version fails
b) where/what/why this 257 value comes from, and why it works ?
also, one of the documents is an Excel document, the above method only works
for word docs, can anyone point me in the direction of how to code for Tray
1 manual feed for Excel objects ??
thanks
_scott
I have used Office XP VBA to automated some of our company contract
documents. one of the final steps to the process was making the documents
print to the manual tray 1 of the given printers.
the following snip of code was what I tried first
<snip>
'create contract
Set wdContract = Documents.Add(Template:="G:\contract\docs\contract.dot",
NewTemplate:=False, DocumentType:=0)
'force to print from manual feed tray
wdContract.PageSetup.FirstPageTray = wdPrinterManualFeed
wdContract.PageSetup.OtherPagesTray = wdPrinterManualFeed
</snip>
this was derived from the inline suggestion that the IDE makes ! but upon
running the code, it seemed to ignore this instruction, but no errors were
thrown up.
I then created a new blank doc and used the macro recorder and obtained the
following
<snip>
wdContract.PageSetup.FirstPageTray = 257
wdContract.PageSetup.OtherPagesTray = 257
</snip>
this seems to work completely as expected ! I'm not looking a gift horse
.....etc. etc. etc., but can anyone shed light as to
a) why the first version fails
b) where/what/why this 257 value comes from, and why it works ?
also, one of the documents is an Excel document, the above method only works
for word docs, can anyone point me in the direction of how to code for Tray
1 manual feed for Excel objects ??
thanks
_scott