Hi All,
The premise I'm struggling with is to save excel attachments to folders on my PC automatically, but using a rule that looks for specific words in attachments, saves them to different folder locations.
For example test in subject, in email 1, would send it to folder1. Then test2 in subject, in email 2, would send it to folder2.
I've found a useful VBA online and changed it slightly to work with my data, it works perfectly, but I can only get it to work for 1 subject/folder.
I need 3 different subject words in the email, starting a rule to run a script, to send each attachment t different folders.
The moment I add a second module in VBA I can't see any of the scripts.
Or if I add another script, below the first one, but change the file directory it stops working.
Please see the VBA below and can someone tell me what I am doing wrong?!
Thanks in advance for any help offered.
Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "MY FOLDER LOCATION"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
The premise I'm struggling with is to save excel attachments to folders on my PC automatically, but using a rule that looks for specific words in attachments, saves them to different folder locations.
For example test in subject, in email 1, would send it to folder1. Then test2 in subject, in email 2, would send it to folder2.
I've found a useful VBA online and changed it slightly to work with my data, it works perfectly, but I can only get it to work for 1 subject/folder.
I need 3 different subject words in the email, starting a rule to run a script, to send each attachment t different folders.
The moment I add a second module in VBA I can't see any of the scripts.
Or if I add another script, below the first one, but change the file directory it stops working.
Please see the VBA below and can someone tell me what I am doing wrong?!
Thanks in advance for any help offered.
Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "MY FOLDER LOCATION"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
Last edited: