![]() |
| 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. |
|
|||||||
| Tags: attachments, email, folder, programmatically, save |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a set of folders in a mailbox in Outlook 2003 that I need to work
with. Specifically, I want to create a procedure that will scan through a folder and check each email for the following: -check to see if there is an attachment, or even multiple attachments. -If there are attachment(s), then it should save them to some specified folder. -If there are no attachment(s), then it should go and check the next email. Is that something fairly trivial to achieve in Outlook? I have experience writing VBA scripts for Word and Access, but I haven't delved into programming much at all for Outlook...any ideas would be greatly appreciated. |
| Ads |
|
#2
|
|||
|
|||
|
Dim oItem As Outlook.MailItem
Dim colItems as Outlook.Items Set colItems = oFolder.Items For Each oItem in colItems If oItem.Attachments.Count 0 Then 'detach attachments here End If Next That snippet would be passed a MAPIFolder object. For code you can modify to detach the attachments see http://www.slovaktech.com/code_sampl...ripAttachments. That strips attachments from items selected in a folder view. It can be modified to have a specific item passed into it, just remove the For Each objMsg In objSelection loop and the initial initialization code that sets the Outlook object (use a global one) and the selection collection and pass in objMsg into the Sub. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Brian Beck" wrote in message ... I have a set of folders in a mailbox in Outlook 2003 that I need to work with. Specifically, I want to create a procedure that will scan through a folder and check each email for the following: -check to see if there is an attachment, or even multiple attachments. -If there are attachment(s), then it should save them to some specified folder. -If there are no attachment(s), then it should go and check the next email. Is that something fairly trivial to achieve in Outlook? I have experience writing VBA scripts for Word and Access, but I haven't delved into programming much at all for Outlook...any ideas would be greatly appreciated. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programmatically populating an email but allowing user opportunity to edit | zulu113cep@yahoo.com | Outlook and VBA | 1 | April 19th 06 12:08 AM |
| How to differ between received and sent email programmatically | Darius | Add-ins for Outlook | 3 | April 6th 06 09:06 PM |
| After Sending Email: Save Copy of Message to Windows Folder | Ben | Outlook and VBA | 1 | March 25th 06 08:17 AM |
| How to add a bitmap footer to each outgoing email programmatically | Herve cadieu | Outlook and VBA | 3 | March 13th 06 06:39 PM |
| save attachments | NascarDude | Outlook Express | 2 | February 12th 06 11:36 PM |