![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi All,
I'm writing a macro in vba for Outlook 2000. My users need to print an email with all of it's attachments, and then flag the email for follow up. I have the flagging all set, and the email prints with most of the attachments. However, if there are 2+ excel files attached (i've only noticed this with Excel) one of them will not print. It seems like excel doesn't open and print fast enough to get to all of them, so one of them is just skipped. Has anyone else experienced this problem, and if so is there any way around it?? Thanks |
Ads |
#2
|
|||
|
|||
![]()
Show your code for printing the attachments?
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan over in IT" wrote in message oups.com... Hi All, I'm writing a macro in vba for Outlook 2000. My users need to print an email with all of it's attachments, and then flag the email for follow up. I have the flagging all set, and the email prints with most of the attachments. However, if there are 2+ excel files attached (i've only noticed this with Excel) one of them will not print. It seems like excel doesn't open and print fast enough to get to all of them, so one of them is just skipped. Has anyone else experienced this problem, and if so is there any way around it?? Thanks |
#3
|
|||
|
|||
![]()
Hi Sue,
Public Sub PrintSelectedEmails() Dim oOutlook As Outlook.Application Dim oNamespace As Outlook.NameSpace Dim oMailItem As Outlook.MailItem Dim i As Long Set oNamespace = Application.GetNamespace("MAPI") For i = 1 To Application.ActiveExplorer.Selection.Count Set oMailItem = Application.ActiveExplorer.Selection.Item(i) ' Select the selected item to flag it oMailItem.FlagStatus = olFlagMarked ' Marks the flag oMailItem.FlagRequest = "Follow up" ' Sets flag for follow up oMailItem.Close olSave ' Saves the flag and closes the message Set oMailItem = Application.ActiveExplorer.Selection.Item(i) ' Select the selected item to print it oMailItem.Body = oMailItem.Body ' modifying the body of the mail item reformats it to Rich Text oMailItem.PrintOut ' Print's out email using users preference ' For this to work properly with attachments, users must specify so in print options Pause (oMailItem.Attachments.Count) oMailItem.Close (olDiscard) ' don't save the email in Rich Text format, preserve original format Next i Set oMailItem = Nothing Set oNamespace = Nothing End Sub There is my function, the pause routine just waits 3 * the number passed in seconds and I did that so that the attachments would print at least grouped with the email, instead of all the emails, then all the attachments in random order. I've tried printing then flagging, so that I only have to set the item once, but I change the format because of the HTML issue, and I'm trying not to save it in RTF if I can avoid that... Thanks in advance for any help you can give. Dan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to put in Access that will send an Email with Attachments | [email protected] | Outlook and VBA | 1 | April 9th 06 06:30 PM |
Automatically trigger a VBA macro to run when connection to exchange server has been made. | [email protected] | Outlook and VBA | 1 | January 30th 06 11:29 PM |
Automatically trigger a VBA macro to run when connection to exchange server has been made. | [email protected] | Outlook and VBA | 0 | January 25th 06 09:52 PM |
put macro into MS Outlook 2000 | David C | Outlook and VBA | 4 | January 25th 06 06:00 PM |
Outlook 2000 - Button to run Macro then open Database | David C | Outlook and VBA | 1 | January 25th 06 04:44 PM |