How do I get Subscription report attachments to save to disk?
This will require Outlook and an Outlook rule to save the attachment to disk.
Follow the steps below to create an Outlook rule that will output the attachment to a specified location:
- Open the VBA IDE in Outlook(Shortcut key is Alt-F11)
- Insert the code below into the Modules section, you can find Modules by expanding the tree on the left side until you see Modules (If there is not a Module item under Modules, create one by Right-Clicking on Modules and choose Insert -> Module)
Public Sub saveAttachtoDisk (itm As Outlook.MailItem) Dim objAtt As Outlook.Attachment Dim saveFolder As String saveFolder = "c:temp" For Each objAtt In itm.Attachments objAtt.SaveAsFile saveFolder & "" & objAtt.DisplayName Set objAtt = Nothing Next End Sub
- Where it says "saveFolder" in the code above, modify this to match the destination of your choice.
- Paste the code above into the main VBA window
- Close out of the VBA IDE
This will allow you to use this script in the rules section. Follow the steps below to create the Outlook rule that will use this:
- Create a new Rule(Tools -> Rules and Alerts -> New Rule)
- On the first screen, select "Check messages when they arrive"
- On the next screen, specify criteria that will match the message you get for subscriptions(I.E Search for attachment extension type, or specific words in the subject/body)
- On the third screen, choose "Run a script". You should be able to click the underlined word "Script" and see the code pasted from earlier
- Click "Finish"
After these steps have been performed, when you receive a Subscription e-mail, the attachment should be saved to the location you specified in the code.