# Printing from multiple trays using HP printer



## t2303 (Aug 5, 2004)

Hello,
I have a 4100 HP printer with 3 trays, I have noticed that my predecessor has installed some functions in a word 2002 form/document that has the ability to print to specific printers, by merely pressing an icon on the toolbar. There are about 3 different icons that represent different HP printers, and presumably you can add as many icons/printers as you desire. Furthermore, each printer possesses a slightly different function, for instance one of them is able to print multiple documents from different trays. The particular function I am interested in, is the ability to print the same document from 2 different trays on the same 4100 HP printer simultaneously, as we have 2 different types of letter-headed paper, and printouts need to be done on each of them. I was wandering if this type of function was a specific HP configuration/plugin or whether it was something that can be done in Word 2002 itself. Many aplogogies for this long-winded explanation, and indeed if it not a specific HP issue. Thanks in advance for any assistance.


----------



## atomiton (Dec 22, 2004)

*printing to multiple trays.*

I'm having a similar problem... we tried to use a macro:

This is the code we have in the macro... you can then attach the code to a button.

I'm having problems with this in Word 2003 but it seemed to work in XP.

Option Explicit

Public WithEvents App As Application

Private Sub App_DocumentBeforeClose(ByVal Doc As Document, Cancel As Boolean)
' Occurs immediately before any open document closes.

' Check to see if the document contains any bookmarks
' If it does then the document being closed is the template itself as the bookmarks are all
' removed from the printed document.
If ActiveDocument.Bookmarks.Count <> 0 Then
Exit Sub
End If

' Insert additional print coding here
With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With

' Format Page
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(1)
.BottomMargin = InchesToPoints(1)
.LeftMargin = InchesToPoints(1.25)
.RightMargin = InchesToPoints(1.25)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
'.BookFoldPrinting = False
'.BookFoldRevPrinting = False
'.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
End With

Dim NumPages As Integer
Dim Counter As Integer

NumPages = ActiveDocument.Content.ComputeStatistics(wdStatisticPages)
Counter = 1

While Counter <= NumPages
'First Tray
'With ActiveDocument.PageSetup
' .FirstPageTray = 261
' .OtherPagesTray = 261
'End With

'Print First Tray
'Application.PrintOut FileName:="" ', Range:=wdPrintRangeOfPages, _
'Item:=wdPrintDocumentContent, Copies:=1, Pages:=Counter, _
'PageType:=wdPrintAllPages, ManualDuplexPrint:=False, _
'Collate:=True, Background:=True, PrintToFile:=False, _
'PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
'PrintZoomPaperHeight:=0

'Second Tray
With ActiveDocument.PageSetup
.FirstPageTray = 260
.OtherPagesTray = 260
End With

'Print Second Tray
Application.PrintOut FileName:="" ', Range:=wdPrintRangeOfPages, _
'Item:=wdPrintDocumentContent, Copies:=1, Pages:=Counter, _
'PageType:=wdPrintAllPages, ManualDuplexPrint:=False, _
'Collate:=True, Background:=True, PrintToFile:=False, _
'PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
'PrintZoomPaperHeight:=0

'Third Tray
With ActiveDocument.PageSetup
.FirstPageTray = 259
.OtherPagesTray = 259
End With

'Print Third Tray
Application.PrintOut FileName:="" ', Range:=wdPrintRangeOfPages, _
'Item:=wdPrintDocumentContent, Copies:=1, Pages:=Counter, _
'PageType:=wdPrintAllPages, ManualDuplexPrint:=False, _
'Collate:=True, Background:=True, PrintToFile:=False, _
'PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
'PrintZoomPaperHeight:=0

Counter = Counter + 1
Wend
End Sub


----------



## arouhi (Dec 27, 2004)

*Suggestion*

Just a suggestion...

Simply setup two printers in client's PC (both hooked up to the same physical printer). Then set the paper handling (trays) in each one to your desire settings (i.e. Tray 1=Letter head type 1 and Tray 2=Letter head type 2) and then modify your code to print to newly setup printers...


----------

