Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Store Printer in Template (2003/SP1)

    Is there a way...to store the printer the document is supposed to be printed on in a template? These are medical documents printing to a hospital and different report types must be printed in different departments and it would simplify things if we could tell the template which printer to print on.

    Otherwise, I get to write the printing macro from hell since we also have to add "personalized" copy notations in the footer for each physician who gets a copy...ARGGHH!

    Thanks, as always.

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

    Re: Store Printer in Template (2003/SP1)

    Word doesn't store which printer to use in a document or template, so you'll have to use a macro. Don't forget to set the printer back to the original one after printing - users will grumble if your template changes the default printer permanently.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Store Printer in Template (2003/SP1)

    A single instance of Word only has one "active printer" at a time. When a document based on the template is opened, you could switch the printer, and when the document is closed you could switch it "back." But this would affect all documents in that session of Word. While in theory you could open different instances of Word, it could be quite confusing to users who are unlikely to realize the underlying difference. So a macro probably is best.

    In my youth, using Word 2.0c, I have a very complex WordBasic macro that let you choose your printer and change your paper trays as part of a unified print process. But I don't think your macro needs to be so bad. By detecting the ActiveDocument.AttachedTemplate, you can pre-toggle the printer so that when the dialog displays, the user shouldn't have to do anything. Intercepting FilePrintDefault (the toolbar button that prints to the active printer without a dialog) is easy enough, and you can mostly get it right without asking, but I personally would want to show the dialog anyway, just in case the code wasn't working properly. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Store Printer in Template (2003/SP1)

    OK, here is what I am proposing and tell me if this makes sense. Each template will have as a custom document property containing the name of the printer(s) to print to. We also have to print a personalized copy for each physician listed in the Copy: list. So, how about if I write a macro that opens each document, prints the first copy to Printer1 (the original with no personalized copy notation) and any additional copies to Printer2, putting the CopyX field in as a footer as shown in the attached sample.

    If that logic makes sense, I will go about trying to write the damn thing (pardonnez mon francais). The macro will need to open each document in a designated directory, print the original to printer1, the name of which is in the custom doc property, then print the copies to the printer name contained in custom doc property Printer2 with each CopyX notation in the footer. Then the document can actually be deleted. It has already been stored in the archive folder.

    Any comments/suggestions would be appreciated.
    Attached Files Attached Files

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Store Printer in Template (2003/SP1)

    Only one suggestion: If you use a DOCVARIABLE field in your footer, you can change the variable to the value of the CopyX property, rather than having to change the property name in the DOCPROPERTY field.

Posting Permissions

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