How to automatically download/save attachments from Outlook to a certain folder?
Generally speaking, you can save all attachments of one email with clicking Attachments > Save All Attachments in Outlook. But, if you need to save all attachments from all received emails and receiving emails, any ideal? This article will introduce two solutions to automatically download attachments from Outlook to a certain folder.
Office Tab: Enable Tabbed Editing and Browsing in Office, Just Like Chrome, Firefox, IE 8/9/10.
Classic Menu: Bring Old Menus and Toolbars Back to Office 2007, 2010, 2013, 2016 and 2019.
This method will introduce a VBA script, and run this scrip with a rule to automatically download and save Outlook attachments to a certain folder. Please do as follows:
1. Press Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and then paste below VBA script into the new opening Module window.
VBA: Auto Save Outlook Attachments into a certain folder
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem) Dim oAttachment As Outlook.Attachment Dim sSaveFolder As String sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\" For Each oAttachment In MItem.Attachments oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName Next End Sub
Note: Please find out sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\", and replace the destination folder’s path as you need.
3. Save the VBA Script and close the Microsoft Visual Basic for Applications window.
4. Go to the Mail view, and click Home > Rules > Manage Rules & Alerts. See screenshot:
5. In the opening Rules and Alerts dialog box, please click the New Rule button on the E-mail Rules tab. See screenshot:
6. Now in the Rules Wizard dialog box, please click to select the Apply rule on messages I receive option, and click the Next button.
7. In the Rules Wizard (which condition(s) do you want to check?) dialog box, please uncheck any option, and click the Next button. And then click the Yes button in the popping up Microsoft Outlook dialog box. See screenshot:
8. Now in the Rules Wizard (what do you want to do with the message?) dialog box, please: (1) Check the run a script option; (2) Click the text of a script to open the Select Script dialog box, select the script we added in Step 2 and click the OK button; (3) Click the Next button.
9. In the Rules Wizard (Are there any exceptions?) dialog box, please click the Next button directly.
10. Now in the last Rules Wizard dialog box, please name the rule in the Step 1 box, check options as you need in the Step 2 section, and click the Finish button.
11. Close the Rules and Alerts dialog box.
And now all attachments are downloaded from your email account and saved into the specified destination folder. And all attachments of incoming emails will be automatically downloaded and saved into the specified folder too.
If you have Kutools for Outlook installed, you can apply its Auto Detach option to automatically download all Outlook attachments and save to a certain folder easily.
Kutools for Outlook - With more than 20 handy Outlook add-ins, free to try with no limitation in 60 days
1. Click Kutools > Options. See screenshot:
2. In the Attachment Options dialog box, go to the General tab, and: (1) Check the Automatically detach all received attachments option; (2) Click the Browse button to specify the destination folder; (3) Check the Create subfolders in the followings style option, and specify a folder structure from below drop down list; (4) Click the Ok button. See screenshot:
From now on, all attachments of incoming emails will be automatically downloaded and saved into the specified destination folder.
100+ Powerful Tools and Features for Outlook 2010 / 2013 / 2016 / 2019 / Office 365:
Compatible with Outlook 2010 / 2013 / 2016 / 2019 / Office 365 (32/64);
Compatible with Windows XP, Windows Vista, Windows 7 / 8 / 10, Windows Server 2003/2008, Citrix System and Windows Terminal (Remote Desktop) Server;
Free trial without feature limitation in 45 days!
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 8 months agoHi, if you need to manage widely the attachments this solution is the best, but if you own a Dropbox account there are some email providers that automatically upload every attachment to Dropbox account. It means that you get the attachment in dropbox folder even if you hadn't read the email. I use servermx.com because they did a customization about the Dropbox path where I need to put the attachments.
To post as a guest, your comment is unpublished.· 10 months agoHi there,
After having gone through all the steps it does work. The only thing is that while it saves the message as a png file, I would also like the script to actually go to the link in the message and download the data from there. Any good ideas how to extend the script?
To post as a guest, your comment is unpublished.· 11 months agoI need help please !
I have implemented the rule and the macro as explained. I have even added a msgbox line to make sure that all was ok and it is as the mail subject is properly displayed but the attachement is not saved
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
MsgBox "Mail Subject: " & MItem.Subject
sSaveFolder = "C:\Users\regis\Documents\Attach\"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
What am I doing wrong?
To post as a guest, your comment is unpublished.· 10 months agoHi, had a problem with it as well. For me, it were the Outlook settings under Trust Centre. All macros had been disabled. Once I enabled the macros to run on outlook, the script appeared to run and save the file.
To post as a guest, your comment is unpublished.· 11 months agoHi Regis,
It's hard to figure out the problem. What about trying Kutools for Outlook’s Automatically Detach feature? This feature only requires you to check one options, and all attachments will be automatically downloaded to the specified folder in futre!
To post as a guest, your comment is unpublished.· 11 months agoI should add that I am using a gmail inbox
To post as a guest, your comment is unpublished.· 1 years agoWith the VBA script, it's running perfectly for the whole mailbox but I just need to save attachments form a specific folder. Can anyone help me ?
To post as a guest, your comment is unpublished.