none
Need VB script for Outlook 2007 rule to print to specifc printers not default. RRS feed

  • Question

  • How can I create a script that I can add to an rule which sorts incoming mail to certain folders to print to a specific printer which will not be the default printer.  I need to create several of these rules for messages in certain folders to go to different network printers.

    Tuesday, June 12, 2012 9:12 PM

Answers

All replies

  • There is no way to do that - Outlook does not provide any access to the printing functionality beyond the MailItem.PrintOut method.

    You can however export any Outlook message (RTF, TXT, HTML, etc.), then programmatically load it to Word and print it out.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Tuesday, June 12, 2012 9:19 PM
  • How would I programmatically have Word print it out?
    Tuesday, June 12, 2012 9:22 PM
  • The PrintOut method doesn't allow you to choose a printer, not control any print options whatsoever.  Some tools here may help you:

    Control How Messages are Printed | Slipstick Systems:
    http://www.slipstick.com/outlook/email/control-how-messages-are-printed/

    Eric Legault
    MVP (Outlook)
    About me...
    Time-saving Outlook Appins
    for as low as $5!

    Tuesday, June 12, 2012 9:24 PM
    Moderator
  • I looked the workarounds from the link you provided but how can I "Go back to the Message tab, choose Other Actions, View in Browser then print from the browser" programmatically (no user involvement)?

    Tuesday, June 12, 2012 9:31 PM
  • You'd have to execute that Ribbon button, but I think you'd have to "repurpose" it, which means you'd have to provide your own functionality to save it as an .mht file the way Outlook does, then use the API of the default browser to open and print it.  I also don't believe you can use the old CommandBars interfaces in Outlook 2007/2010 to execute the "View In Browser" CommandBarButton (but I'm not sure you'd want to in this case).

    The long and short of it - you can't do anything useful with the Outlook Object Model for printing.  It's all tricks and lots of work.


    Eric Legault
    MVP (Outlook)
    About me...
    Time-saving Outlook Appins
    for as low as $5!

    Tuesday, June 12, 2012 9:38 PM
    Moderator