Preface: I don't know VBA, just "Alt + F11" and pasting in the code. Please be nice![]()
I have an Outlook rule that triggers a script which saves the attachment to a folder (works)
I need to setup a 2nd rule to trigger a 2nd script (same script as 1st, but with a different file name)
Creating a 2nd module with 2nd script didn't show up as an option during Rule setup. I can't create a 2nd project to reference either. How can I have a 2nd rule run a 2nd script? I want the rule to decide what needs to be done as I don't know VBA enough to have the script decide the needed action.
Working Rule: If Email is from "Sender-x" & Subject equals "Subject-1" then Run "Script-1"
Working Script-1:
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "https://website.com/folder/"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\File Name-1.txt"
Set objAtt = Nothing
Next
End Sub
2nd Rule Needed: If Email is from "Sender-x" & Subject equals "Subject-2" then Run "Script-2"
Needed Script-2:
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "https://website.com/folder/"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\File Name-2.txt"
Set objAtt = Nothing
Next
End Sub
Bookmarks