Step 1: Open your Outlook and enable micro.
File>>Option>> Trust Center>> Trust center settings>> Select notification for all macros
Step 2: Then press Alt+F11 to open VBA. Go to ‘Module’ from left panel or you can add one new one if you don’t see it there.
Step 3: Paste the below code and save it.
Public Sub SaveAutoAttach(item As Outlook.MailItem) Dim object_attachment As Outlook.Attachment Dim saveFolder As String ' Folder location when I want to save my file saveFolder = "D:\Data\Archive" For Each object_attachment In item.Attachments ' Criteria to save .doc files only If InStr(object_attachment.DisplayName, ".doc") Then object_attachment.SaveAsFile saveFolder & "\" & object_attachment.DisplayName End If Next End Sub
Step 4: Now Go to Rule>>Manage Rules & Alerts. Please follow below snapshots.
Step 5: Select ‘Apply rule on message I receive’ and Next
Step 6: In this step choose your words sincerely. Right now I am choosing 2nd option. Whatever you select on the first panel you will see them in 2nd panel. Click on ‘Specific word’ circled in the image.
Step 7: Provide the word like “IBM Data” and save it. You can add more words as well.
Step 8: In this step we will select ‘Action’. As we want to run a VBA script, we select ‘run a script’. Again click on ‘run a script’; a pop-up windows may open. Just ‘Enable’ the micros and select the micro which we saved in backend.
Step 9: You are almost done. Save the rule as per your convenience and click ‘Finish’. Select the circled check box if you want to run the script on deleted items otherwise it’s good.
Step 10: Restart your outlook and send some document with subject ‘IBM Data’ and see the magic.