Results 1 to 4 of 4
  1. #1

    Default Printer for a document

    Is there any way to assign a printer to a document. I have some items that i need to print on my local laserjet and others that i want to print on the office color inkjet?

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Melbourne, Victoria, Australia
    Thanked 295 Times in 267 Posts

    Re: Default Printer for a document

    You would need code to do this. The maintenance for new files would be too large an overhead unless you attached the macro to templates and used different templates for each file group.

    As a possible option you could use an undocumented (I think) dialog that Word97 contains and may still be in Word2000. It could be called as part of the print command if you wanted to see it every print.
    Sub SetDefaultPrinter()
    'Changes setting of system default and current printer from within Word
    End Sub
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Brisbane, Queensland, Australia
    Thanked 1 Time in 1 Post

    Re: Default Printer for a document

    It works in 2000
    David Grugeon
    Brisbane Australia

  4. #4
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Sun Prairie, Wisconsin, Wisconsin, USA
    Thanked 128 Times in 123 Posts

    Re: Default Printer for a document

    What I've done instead is implement a floating toolbar button that is enabled and made visible by the documents going to the special printer. In my case, I use one printer just for envelopes so it is in my envelope template.

    The macro called by it collects the current printer setting in a variable, changes the printer to the envelope printer, prints the document, and then changes the printer setting back.

    The macros and toolbar button are stored in a global template.

    Print macro:
    SubEnvPrint ()
    Dim sMyActivePrinter As String
    sMyActivePrinter = ActivePrinter
    ActivePrinter = "HP LaserJet IIIP"
    Application.PrintOut FileName:="", _
    Range:=wdPrintCurrentPage, Item:= _
    wdPrintDocumentContent, Copies:=1, _
    Pages:="", PageType:=wdPrintAllPages, _
    Collate:=True, Background:=True, _
    PrintToFile:=False, PrintZoomColumn:=0, _
    PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
    ActivePrinter = sMyActivePrinter
    End Sub

    Also in the global:

    Sub EnvelopeOpen()
    Application.CommandBars("Envelope Toolbar").Enabled = True
    Application.CommandBars("Envelope Toolbar").Visible = True
    End Sub

    The envelope template has AutoNew and AutoOpen macros:

    Sub AutoNew()
    Application.Run MacroName:="EnvelopeOpen"
    End Sub

    Sub AutoOpen()
    Application.Run MacroName:="EnvelopeOpen"
    End Sub

    In the AutoExec macro for the global are the following:
    Word.CommandBars("Envelope Toolbar").Enabled = False
    Word.CommandBars("Envelope Toolbar").Visible = False

    This keeps the toolbar from being in the way unless it is needed. I could hide it again when the document is closed but it's just as easy to click on the close box on the toolbar.

    This way, I don't end up sending my letters to the envelope printer because the printer settings go back to what they were.

    If needed, I suppose you could have the macro call up the print dialog instead of printing. Also, this way the bulk of the code is centrally located so if I change the printer I only need to change the code in one spot rather than in multiple envelope templates.

    For more on global templates see:
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts