Results 1 to 15 of 15
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    San Jose, California, USA
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default printer for a document (2003 SP2)

    I'd like to set a default printer for a specific document, but there doesn't seem to be a way to do this. My default printer is a b&w laser printer, but I have some documents I print fairly often that have color in them, and I'd like to set the default printer for those documents to my color printer. Is there a way to do this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Default printer for a document (2003 SP2)

    The default printer is not a property of a document, but of the Application object, so if you set the printer in one document, it will apply to all other documents too. You could create code in the ThisDocument module, to set the printer in the Document_Open event procedure and reset it to the original in the Document_Close event procedure, but even then it would apply to all other open documents.

  3. #3
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    The solution I use is simple: two Print-buttons on the toolbar. On button makes my laser the default and prints the active document, the other makes my inkjet the default and then prints the active document. Behind each button is a very simple macro. Go to Word's Visual Basic editor, look for "Normal" at the left hand pane and select that. Go to menu Insert and choose Module. In the right pane, type or copy the following lines of code:

    Sub PrintToLaser()
    ActivePrinter = "MyLaserPrinter"
    ActiveDocument.PrintOut
    End Sub

    Sub PrintToInkjet()
    ActivePrinter = "MyInkjetPrinter"
    ActiveDocument.PrintOut
    End Sub

    The trick is to know what to replace "MyLaserPrinter" & "MyInkjetPrinter" with. In Word's Visual Basic Editor (Alt+F11), open the Immediate window with Cntrl+G if it's not already open and in that window type "?Activeprinter" (without the quotes), followed by an Enter. Below this line you will see the correct string for the current default printer. Assuming this is the laser, use this string to replace the "MyLaserPrinter" string in the first Sub above. Make sure there are double quotes before and after this string.
    Then go to Start | Printers and faxes, rightclick on the inkjet printer and choose Make Default. Now repeat the steps in the Visual Basic editor to get the correct string for your inkjet printer and use it to replace the "MyInkjetPrinter" string in the second sub above.
    Now save your work by clicking on the Save button in the Visual Basic editor. Close this editor.
    Final task is to create the two buttons. Rightclick on the Toolbar area and in the popup menu choose the last entry (Edit...?). Click the Command tab and on the left pane scroll down a little and choose Macros. In the right pane you'll see the two macros you've just entered. Click and drag them one by one to the desired location on the Word Toolbar. You can choose an different icon for the buttons to keep them apart.
    (I've a Dutch Word version, so not sure about the correct names of menus in English.)

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Default printer for a document (2003 SP2)

    You could do this using a procedure called from the DocumentChange event, and modify the default printer every time a different document is activated.

    StuartR

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Default printer for a document (2003 SP2)

    I know, but I wanted to avoid getting into application level events <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  6. #6
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    San Jose, California, USA
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    Thanks, Jan. That sounds really easy. I'll try it.

  7. #7
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    San Jose, California, USA
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    Jan,

    On reading your suggestion again, I have a question. Why do I need a macro to print to the default printer? Could I not just use one macro to print to the inkjet and then change the default back to my laser printer?

    Sub PrintToInkjet()
    ActivePrinter = "MyInkjetPrinter"
    ActiveDocument.PrintOut
    ActivePrinter = "MyLaserPrinter"
    End Sub

    Then I'd need just one extra button on my toolbar.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Default printer for a document (2003 SP2)

    Yes, that would be sufficient.

  9. #9
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Default printer for a document (2003 SP2)

    If you use a macro to change the activeprinter you need to be aware that this can cause repagination issues. When a different printer is chosen, the document must repaginate to that printer before it can print. The use of the described macro may lead to some puzzling outputs if the two printer drivers cause the page breaks to appear in different places.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  10. #10
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    San Jose, California, USA
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    What's the difference between using the macro and selecting another printer from the print menu? What does the latter do that the former does not?

  11. #11
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Default printer for a document (2003 SP2)

    There is no difference as to how the printer is set but there is a difference if you immediately follow the line of code with the Print command. The selection of a printer from the print menu means that the document you see on screen is paginated (after the print dialog is closed) for the printer you are outputting to rather than a different printer. This allows you the chance to review your document's pagination for the actual printer being used rather than making a temporary change and then reversing this change after printing.

    If these steps are separated then you as the user will at least get a chance to review the pagination and know what the result will look like for that colour printer. If you do it all in a single macro then this is not the case. In smaller files this is not such an issue but in large docs where pagination is important then you might find the all-in-one approach is not without problems.

    I agree that the difference is subtle but I thought it would be useful to point it out since WYSI not WYG in the single macro and this can only be avoided fully by using the document events to format each document according to the printer you intend to use.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  12. #12
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    San Jose, California, USA
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    OK, thanks for the info. How do you know this? Where is it documented? It's not in Woody's book ("The Only Office 2003 Book You Need"). Do the same rules apply in the other Office apps? I presume they do.

  13. #13
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Default printer for a document (2003 SP2)

    If you look in the online help you may find it mentioned in regards to a compatibility option called Use printer metrics to lay out document. It's certainly in Word 2000's online help. However, the true nature of the problem is only alluded to there - you can't ensure that pagination of any document is the same for all users or printers.

    To understand the issue further you might want to do a search on this forum, google or google groups where you will find numerous mentions.

    I have never noticed it in other applications but I would expect it to occur to some extent in any application where the typeface is not embedded into the file and whereever printer drivers use typeface substitution to speed print jobs. I expect that it is a relatively minor problem that appears most often in Word processing docs where, cumulatively a large number of tiny positional differences can add up to noticeable pagination differences.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  14. #14
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    Yes, as Hans said, that would be sufficient.
    I use two different macros because there's more code in them then needed for this simplified example. Should have seen that right away.

  15. #15
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default printer for a document (2003 SP2)

    You're right of course, Andrew, about the possible repagination issues.
    But in our company the Use printer metrics to lay out document is by default UNchecked. The reason is that we use the PDF format to store all finalized documents. And we've found that leaving this option checked, creating a PDF file by "printing" to Acrobat PDFWriter would cause an unwanted repagination of the file. Thus changing the document which is unacceptable, according to our legal staff.
    Also, all our company templates are set to sufficiently wide margins; there are no problems regarding inkjets needing a wider (especially bottom) margin than lasers. So in daily practice we don't have any issues with repagination using different printers.

Posting Permissions

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