Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

How to - MAcros to automate printing functions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tongers - 22 Sep 2006 09:54 GMT
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.
Graham Mayor - 22 Sep 2006 10:12 GMT
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.

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> 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.
tongers - 22 Sep 2006 12:41 GMT
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.

> The following should work then return everything to the start condition.
>
[quoted text clipped - 37 lines]
> > and print copy of whole doucment all on plain sheets - to be done all
> > in one macro.
Graham Mayor - 22 Sep 2006 12:51 GMT
See http://www.gmayor.com/installing_macro.htm

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> 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
[quoted text clipped - 53 lines]
>>> and print copy of whole doucment all on plain sheets - to be done
>>> all in one macro.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.