Automatically download Outlook attachments

Automatically download Outlook attachments to folder using VBA and Outlook rule

To achieve this automation which automatically download and save Outlook attachments to a chosen folder, you need to create a VBA script and run this script with a rule to. 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 SaveOutlookAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oOutlookAttachment As Outlook.Attachment
Dim sSaveAttachmentsFolder As String
sSaveAttachmentsFolder = “ D:\ServerReports\outlook-attachments\
For Each oOutlookAttachment In MItem.Attachments
oOutlookAttachment.SaveAsFile sSaveAttachmentsFolder &                   oOutlookAttachment.DisplayName
End Sub

Note: You can replace the destination folder’s path as you need. Above code looks as




  1. Save the VBA Script and close the Microsoft Visual Basic for Applications window.
  2. Go to the Mail view, and click Home > Rules > Manage Rules & Alerts. See screenshots:







This selection is optional. If you do not wish to download all attachments, you can select conditions from Fig.4.










Unable to see run a script option in outlook?

a. Right Click on desktop (or any desired folder location) New > New text document.
b. Copy – Paste registry code as shown. (Code in text is given below Fig.7)
c. Save as .reg file with the contents below. (You can give any name)




I. Outlook 2016

Windows Registry Editor Version 5.00




ii. Outlook 2013

Windows Registry Editor Version 5.00




iii. Outlook 2010

Windows Registry Editor Version 5.00



d. Run the .reg file as an admin




f. Restart outlook. (Rebooting in case it do not show)

Back to Attachment process.

Fig.6 (Repeat)








4. Close the Rules and Alerts dialog box.

And now all/desired attachments are downloaded from your email account and saved into the specified destination folder.

Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.

Stay tuned on Knowledge-Junction, will come up with more such articles.

Thanks for reading 🙂


12 thoughts on “Automatically download Outlook attachments

  1. Your solution is great, but for Outlook 2016 (for example), will be much easier to configure a Flow to download all your attachments to OneDrive. I have done that and for me it’s perfect 🙂 Just thought I would throw this out there

    1. Thanks albandrod for sharing one more option. But I guess then user will need Office 365 license for using flow (Office 365 feature). And case might be that users might have Outlook but not Office 365.

  2. Thank you Albandrod for your candour in exceptional technical suggestion. I will try your suggestion shortly and add to this blog. 🙂

  3. I really appreciate the write up. Really helpful. Found another useful tool on internet, SysTools Outlook Attachment Extractor to download attachments from outlook automatically.

  4. Any idea why the option to check the box for ‘run a script’ wouldn’t show up? This is the perfect solution for what I need and I don’t where to go from here.

      1. Yes, unfortunately, the Run a Script option is disabled by default now, so this is no longer possible for those who don’t want to go digging in the registry.

        Alternatives welcomed!?

  5. I tried this. The process is complete. Rule is created and implemented but the attachments are not getting stored.

  6. Does anyone know whether it is possible to change the name of the file attachment being saved in the process? We have a requirement where an app produces attachments with random file names which we would ideally like to convert to something meaningful as we download them…

Leave a Reply to Robin (Ajay) Robert Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: