This VBA sample illustrates how to save attachments from multiple selected items in Outlook.  To download the script, please visit http://gallery.technet.microsoft.com/scriptcenter/Save-attachments-from-5b6bf54b

Scenarios

When multiple items are selected, the Save Attachments option in the File menu will be grayed out, and it's inconvenient to save attachments one by one. This script is useful and can be used to save attachments from multiple selected items all at once.

 

Script

Import the "mAttachmentSaver.bas" file.

Step1. Press Alt+F11 to open the VBE in Outlook.

Step2. Drag the "mAttachmentSaver.bas" file to the Project Explorer (Press Ctrl+R if you cannot see it) or via File >> Import File... (Ctrl+M).

Run the ExecuteSaving macro to save attachments.

Step3. Go back to Outlook UI, and then press Alt+F8 to open the Macros window.

Step4. Select "ExecuteSaving" in the names list, and then click the Run button (Please remember to select Outlook item(s) before running this macro).

Step5. Select a specific folder to save attachments from Browse For Folder dialog box, and then click the OK button.

 

 

Here are some code snippets for your references. To get the complete script sample, please click the Download button at the beginning of this page.

Copy code
Visual Basic
Edit|Remove
' ###################################### 
' Run this macro for saving attachments. 
' ###################################### 
Public Sub ExecuteSaving() 
    Dim lNum As Long 
     
    lNum = SaveAttachmentsFromSelection 
     
    If lNum > 0 Then 
        MsgBox CStr(lNum) & " attachment(s) was(were) saved successfully.", vbInformation, "Message from Attachment Saver" 
    Else 
        MsgBox "No attachment(s) in the selected Outlook items.", vbInformation, "Message from Attachment Saver" 
    End If 
End Sub
 

Last edited Nov 10, 2013 at 7:29 AM by msftdemo, version 3