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

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


Windows Articles / All 35 Views comments

Matthew Adams

by Matthew Adams


Affiliate Disclosure

Outlook rule to download attachments to a folder

Outlook customers typically have to obtain information hooked up to their emails. So, it will be useful if Outlook routinely downloaded all e mail attachments of newly acquired emails. You possibly can configure Outlook to do precisely that with a VBA script and a rule for it.

How can I arrange an Outlook rule for downloading attachments?

1. Arrange the VBA script

  1. First, arrange a VBA script that downloads the attachments to a specified folder. Press the Alt + F11 hotkey, which opens the Microsoft Visible Primary window.
  2. Click on Insert and Module to open a brand 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:UsersDT168Documentsoutlook-attachments”
    For Every oAttachment In MItem.Attachments
    oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
    Finish Sub
  4. Paste that code into the VBA Module window with the Ctrl + V hotkey.
  5. Observe that the ‘C:UsersDT168Documentsoutlook-attachments’ path in that script is an instance. Exchange ‘C:UsersDT168Documentsoutlook-attachments’ with the complete path of the folder to obtain the attachments to.
  6. Subsequent, save the brand new script.
  7. Shut the VBA Module window.

2. Arrange an Outlook rule for the VBA script

  1. To arrange an Outlook rule for the obtain attachment script, click on the Guidelines button.

    The Rules button outlook rule download attachments to folder

  2. Choose Handle Guidelines & Alerts to open the Guidelines and Alerts window.
  3. Click on the New Rule button.
  4. Choose the Apply rule on message I obtain choice and click on Subsequent to open the window proven instantly under. Some customers may want to pick a Examine messages once they arrive choice in older Outlook versions.

    Rules Wizard outlook rule download attachments to folder

  5. Choose the run a script examine field.
  6. Click on a script to open the Choose Script window.
  7. Choose the obtain attachment script within the Choose Script window, and click on the OK button.
  8. Choose the Subsequent choice.
  9. Enter a title for the rule within the textual content field on the final Guidelines Wizard dialog field.
  10. Choose the Activate this rule choice.
  11. You may also choose the Run this rule now on messages already in ‘Inbox’ choice if most popular. The rule description field ought to learn as follows: Apply this rule after the message arrives on this pc solely run <macro title>.
  12. Click on the End button.

Thereafter, Outlook will mechanically obtain attachments to the folder path included within the script. You then gained’t have to manually obtain the attachments. Open the folder path specified within the macro in File Explorer to take a look by way of the attachments.

For any extra questions or strategies, don’t hesitate to succeed in for the feedback part under.