Here's a cool trick. This provides a way to automatically save attachments of emails as they arrive. I have tested this in Outlook 2007.
- Open the VBA IDE in Outlook. Alt-F11 will do this.
- Insert the following code to the Modules section. On the left side there is a tree, expand until you find Modules. Then, if there is not a Module item under Modules, create one by right clicking on Modules. Now past the following code in the main VBA window.
- Close the VBA IDE.
- Create a Rule that calls the script. Tools -> Rules and Alerts -> New Rule...
- In the first screen of the new rule wizard, choose "Check messages when they arrive".
- In the second, you could specify certain criteria that the message must match. Tip: Try "with specific words in the message header" and ".txt" for the search string to save only .txt files.
- On the third screen, choose "run a script". When you click the underlined word, "script", you should see the code that you pasted in the VBA console.
- Click "finish", and test your work.
If this was helpful to you, drop me a note in the comments below.
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
Comments
incremental number at the end
TY
Mike
You could concatenate a
To clarify, this would be
Awesome
Auto Save Outlook Attachment Rule
attachment save?
The script runs but wondering where the attachments are saved? If you can help in this it will be great!
Attachment save location
And it worked like a charm.
Legend, this is exactly what
Post new comment