-
Automatically downloading multiple Attachments to different folders.
Hello all, long story short is that at my job I get around 30-40 emails every morning in Outlook 2010 with account statistics for different accounts. I am currently running this script that I found through pixelchef.net to download the attachments automatically to a folder on my desktop.
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "C:\"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
I like what this script does except for that it dumps all the attachments into the same folder so I still have to manually move them into specific folders for the accounts. I am wondering if there is a way I can change this script so that I can have it download the files to their specific folders based on either the the title of the email or the name of the file? All the file names are the same except for the name of the account. Example "Calls-[insert account name]-[Insert Date].pdf".
I am trying to learn Outlook VBA code but the quicker I can find out how to do this the better. Any help would be greatly appreciated.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules