printing to different trays

D

dave_az

I'm working with Word trying to set the 1st page to one tray and the others to a different tray. Based on the tray IDs provided by HP this macro should work. Has anyone had success doing this in VBA or Word Macro using ID numbers, not wdprintupperbin etc - since that only works on some printers

Code
Sub Macro3(

' Macro3 Macr
' Macro created 1/26/2004 by Milner Workstatio

With ActiveDocument.PageSetu
.FirstPageTray =
.OtherPagesTray =
End Wit

'Prin
ActiveDocument.PrintOu
End Sub
 
J

Jonathan West

Hi Dave,

Don't assume that the HP documentation is correct. Trust nothing other than
the values for the various trays actually returned by the printer driver
itself.

This article shows you how to get a list of the tray names & numbers

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup



dave_az said:
I'm working with Word trying to set the 1st page to one tray and the
others to a different tray. Based on the tray IDs provided by HP this macro
should work. Has anyone had success doing this in VBA or Word Macro using
ID numbers, not wdprintupperbin etc - since that only works on some
printers?
 
J

Jonathan West

Hi Dave

Hmmm. I've never heard of such a problem before. I rather suspect that
something about the document has got corrupted. Any chance of trying this
again on a document you know is clean?

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup


dave_az said:
Double checked using those parameters and we do have the correct printer
tray IDs. what's strange is that after some tinkering it appears the the
pagesetup parameters isn't setting globally as it should. When we move the
code to a macro and check the properties in the header they aren't set the
same as the body??
With ActiveDocument.PageSetup
.FirstPageTray = 256
.OtherPagesTray = 257
End With

So I had to do something crazy like go into the header and set it there
and only there not using the code above.
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With ActiveDocument.PageSetup
.FirstPageTray = 256
.OtherPagesTray = 257
End With


Not making much sense... has anyone successfully setup a VBA program to
use multiple printer trays?? I'm amazed at how little information there
seems to be out there.
 
D

dave_az

I'm wondering if we aren't translating the macro to VB correctly

This macro seems to wor
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
With Selection.PageSetu
.FirstPageTray = 26
.OtherPagesTray = 26
End Wit
ActiveDocument.PrintOu


And This is the VB - similiar to what others have used?

wd1.Selection.HomeKey Unit:=wdStor
wd1.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
With wd1.Selection.PageSetu
.FirstPageTray = CInt(tray1_id
.OtherPagesTray = CInt(tray2_id
End Wit
wd1.ActiveDocument.PrintOu

To further confuse - on one PC using an HP4550 printer ActiveDocument.PageSetup syntax works, but not on the HP4000N printer. Where I had to use Selection instead of ActiveDocument. I'm ready to strangle MS/HP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top