Printing to Multiple trays via VBA

D

Dan Drummond

I wonder if you could help?

We're got 5 users on networked PCs printing to a
networked LJ 4100 with 6 trays (inc. Manual Feed tray
(1)).

I've tried recording a macro going through each type of
print (letterhead, copy, memo, etc.) however the macro
does not record the specific tray selection OR prints
such as letterheads where the first page is printed on
tray 2 (letterheaded paper) and all other pages on tray 3
(plain).

Anyone have any ideas? The users don't want to manually
print to these trays - claim it's too much work! ;-)

Many thanks,




Dan
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Dan Drummond > écrivait :
In this message, < Dan Drummond > wrote:

|| I wonder if you could help?
||
|| We're got 5 users on networked PCs printing to a
|| networked LJ 4100 with 6 trays (inc. Manual Feed tray
|| (1)).
||
|| I've tried recording a macro going through each type of
|| print (letterhead, copy, memo, etc.) however the macro
|| does not record the specific tray selection OR prints
|| such as letterheads where the first page is printed on
|| tray 2 (letterheaded paper) and all other pages on tray 3
|| (plain).
||
|| Anyone have any ideas? The users don't want to manually
|| print to these trays - claim it's too much work! ;-)
||

IIRC, each printer has its own set of constant to identify the trays. You
are going to have to test those out to find out what they are. Usually,
recording a macro can help you figure out each tray's constant.
Once you have those constant, you can use something like:
'_______________________________________
With ActiveDocument.PageSetup
.FirstPageTray = 257
.OtherPagesTray = 258
End With
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False
'_______________________________________

Just figure out all the possible combination your users need and associate a
toolbar button to each macro.
Alternatively, you can make this into a called Sub and call it with a simple
macro. Each of those macros would then be linked to a toolbar button, for
example:

'_______________________________________
Sub PrintTray1_2

AllPrintOptions 257, 258

End Sub
'_______________________________________

'_______________________________________
Sub AllPrintOptions (Tray1 As Long, Tray2 As Long)

With ActiveDocument.PageSetup
.FirstPageTray = Tray1
.OtherPagesTray = Tray2
End With

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False

End Sub
'_______________________________________


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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