Writing a macro in Outlook 2007

G

Guest

Hello -

I have been trying to create code in Outlook 2007 that will send an item to
a specific printer. I realize there is no macro recorder in Outlook, and I am
not a programmer, so I've been trying to manipulate code found on a Microsoft
support page, without success.

Does anyone know the code required to send an item to a specific printer,
other than the default?

Here is a sample of what I've found - it includes resetting the default
printer:

Sub MAIN
'Retrieve and set information about the current default printer
Dim FPS As FilePrintSetup
GetCurValues FPS
'Set the default Printer
DefaultPrinter$ = FPS.Printer
FilePrintSetup .Printer = "HP LaserJet IIISi on LPT1:"
'Send the document to the currently selected printer
FilePrint
'Reset to the original default printer
FilePrintSetup .Printer = DefaultPrinter$
End Sub


I changed the printer name to the printer I wanted to use, but am not sure
how to define my default printer name.

I really do not even need to have the printer reset to the default, as I can
add another button that will print to that specific printer, when needed.

Thanks for any help!
 
S

Sue Mosher [MVP-Outlook]

Outlook has no objects that would allow you to direct output to a specific printer or change the default printer. You would have to reset the system default printer, as at http://support.microsoft.com/default.aspx?scid=kb;en-us;266767

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Thanks so much, Sue!

Sue Mosher said:
Outlook has no objects that would allow you to direct output to a specific printer or change the default printer. You would have to reset the system default printer, as at http://support.microsoft.com/default.aspx?scid=kb;en-us;266767

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top