Why doesnt my macro record paper tray change in printer options?

M

mr t

I have recorded a macro to print one copy of a letter on letterhead, one copy
on plain paper, and then print the envelope.

The macro will not switch from plain paper to letterhead when running (or
from whatever the last setting was)

Thanks

Sub PrntLtrEnv()
'
' PrntLtrEnv Macro
' Macro recorded 6/13/2007 by
'
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=5, Extend:=wdExtend
ActiveDocument.Envelope.PrintOut ExtractAddress:=False,
OmitReturnAddress _
:=False, PrintBarCode:=False, PrintFIMA:=False,
Height:=InchesToPoints( _
4.13), Width:=InchesToPoints(9.5), Address:="Anna Smith", AutoText:= _
"ToolsCreateLabels1", ReturnAddress:="", ReturnAutoText:= _
"ToolsCreateLabels2", AddressFromLeft:=wdAutoPosition,
AddressFromTop:= _
wdAutoPosition, ReturnAddressFromLeft:=wdAutoPosition, _
ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation:=wdLeftLandscape _
, DefaultFaceUp:=True, PrintEPostage:=False
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub
 
G

Graham Mayor

Your macro doesn't change the trays. Assuming that you have already added
the envelope to the document then you need something like

Sub PrintLetterandEnv()
Dim sTray As String
sTray = Options.DefaultTray
Options.DefaultTray = "Envelope Feeder"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="0",
PageType:=wdPrintAllPages
Options.DefaultTray = "Tray 1"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="s2-s99", PageType:= _
wdPrintAllPages
Options.DefaultTray = "Tray 2"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="s2-s99", PageType:= _
wdPrintAllPages
Options.DefaultTray = sTray
End Sub

This will print the envelope to the Envelope Feeder tray and a copy of the
letter to each of trays 1 and 2.
The tray designations may not match your printer. See
http://www.gmayor.com/fax_from_word.htm for background.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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