How to - MAcros to automate printing functions

T

tongers

I need to creat Macro's to automate printing functions in Word 2002 or 2003 -
printer is HP 4250.

e.g print one copy of document on letterhead and continuation sheets and
print copy of whole doucment all on plain sheets - to be done all in one
macro.
 
G

Graham Mayor

The following should work then return everything to the start condition.

Sub PrintToHP4250()
Dim sFirst As String
Dim sSecond As String
Dim sPrinter As String

sFirst = ActiveDocument.PageSetup.FirstPageTray
sSecond = ActiveDocument.PageSetup.OtherPagesTray
sPrinter = ActivePrinter
ActivePrinter = "HP LaserJet 4250 Series PCL"
With ActiveDocument.PageSetup
.FirstPageTray = 261
.OtherPagesTray = 260
End With
Application.PrintOut FileName:=""
With ActiveDocument.PageSetup
.FirstPageTray = 260
.OtherPagesTray = 260
End With
Application.PrintOut FileName:=""
ActiveDocument.PageSetup.FirstPageTray = sFirst
ActiveDocument.PageSetup.FirstPageTray = sSecond
ActivePrinter = sPrinter
'ActiveDocument.Save
End Sub

However there are provisos -

1 - I don't have an HP 4250 printer (or driver) to check
2. - Your HP driver may have a different name than that shown.
3. - The codes for the trays - here Tray 1 for Page 1 Tray 2 for subsequent
pages may be different for the 4250 printer, so record a macro setting the
page setup with the HP printer active to get the codes you require.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
T

tongers

That worked a treat - thanks -now can you help with the next step please -
how do I assign the Macro to a keyboard shortcut and/or Toolbar Button and
the how do I organize all the new Macros I have created into a template
document - not the normal.dot so I can use them elsewhere.
 

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