More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

forum 24-May-2018 19:45

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

    Page [ 1 ]  
 Basic Outlook Printer Friendly Version
Working with Outlook items, folders, recipients; dealing with security; writing event handlers
Outlook 2010 - Print first page - Selection

I understand that this forum is littered with topics on printing the first page in outlook. However, none appear to address printing the first page of a whole selection.

I know in outlook in general, print controls are poor, but in 2010 you can print the first page of an individual email using send keys as follows:
   SendKeys "%FPR"
   SendKeys "%S"
   SendKeys "1"
   SendKeys "{ENTER}"
So based on the above, I have tried to incorporate this into printing a selection of multiple items using the same method.

The following code works correctly for cycling through your active selection and identifying each mail item's subject:
Sub printmultiples()

Dim mymsg As MailItem

For Each mymsg In ActiveExplorer.Selection
Msgbox mymsg.subject

End Sub

I idea is to amend the code to include the send keys instead of the msg subject. Unfortunately this is where it falls down.

The code runs the cycle as usual, but the resulting output is a print off of the same email multiple times (as many as in your selection). The only thing I can think of is the send keys are reacting in a different way when used like this(I know they are not the most reliable).

Any help of suggestions would be greatly appreciated.




  23-May-2013  06:50
    Page [ 1 ]