How to set an Outlook rule to download attachments to a folder

by Matthew Adams
Matthew Adams
Matthew Adams
Windows & Software Expert
Matthew is a freelancer who has produced a variety of articles on various topics related to technology. His main focus is the Windows OS and all the things... read more
Affiliate Disclosure
Outlook rule to download attachments to a folder

To fix various PC problems, we recommend DriverFix:
This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:

  1. Download DriverFix (verified download file).
  2. Click Start Scan to find all problematic drivers.
  3. Click Update Drivers to get new versions and avoid system malfunctionings.
  • DriverFix has been downloaded by 0 readers this month.

Outlook users often need to download files attached to their emails. So, it would be handy if Outlook automatically downloaded all email attachments of newly received emails. You can configure Outlook to do exactly that with a VBA script and a rule for it.

How can I set up an Outlook rule for downloading attachments?

1. Set up the VBA script

  1. First, set up a VBA script that downloads the attachments to a specified folder. Press the Alt + F11 hotkey, which opens the Microsoft Visual Basic window.
  2. Click Insert and Module to open a new module window.VBA window outlook rule download attachments to folder
  3. Copy this VBA code with the Ctrl + C hotkey: 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
    End Sub
  4. Paste that code into the VBA Module window with the Ctrl + V hotkey.
  5. Note that the ‘C:\Users\DT168\Documents\outlook-attachments’ path in that script is an example. Replace ‘C:\Users\DT168\Documents\outlook-attachments’ with the full path of the folder to download the attachments to.
  6. Next, save the new script.
  7. Close the VBA Module window.

2. Set up an Outlook rule for the VBA script

  1. To set up an Outlook rule for the download attachment script, click the Rules button.The Rules button outlook rule download attachments to folder
  2. Select Manage Rules & Alerts to open the Rules and Alerts window.
  3. Click the New Rule button.
  4. Select the Apply rule on message I receive option and click Next to open the window shown directly below. Some users might need to select a Check messages when they arrive option in older Outlook versions.Rules Wizard outlook rule download attachments to folder
  5. Select the run a script check box.
  6. Click a script to open the Select Script window.
  7. Select the download attachment script in the Select Script window, and click the OK button.
  8. Select the Next option.
  9. Enter a title for the rule in the text box on the last Rules Wizard dialog box.
  10. Select the Turn on this rule option.
  11. You can also select the Run this rule now on messages already in ‘Inbox’ option if preferred. The rule description box should read as follows: Apply this rule after the message arrives on this computer only run <macro title>.
  12. Click the Finish button.

Thereafter, Outlook will automatically download attachments to the folder path included in the script. Then you won’t need to manually download the attachments. Open the folder path specified in the macro in File Explorer to have a look through the attachments.

For any more questions or suggestions, don’t hesitate to reach for the comments section below.


idee restoro Still having issues? Fix them with this tool:
  1. Download this PC Repair Tool rated Great on (download starts on this page).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues with Patented Technologies (Exclusive Discount for our readers).

Restoro has been downloaded by 0 readers this month.

This article covers:Topics: