Another big problem not address normally (which should have been) by MicroSoft.
If you want to create rule for mails that are auto forwarded from someone to you, you cannot my simple means. It would have been great if MS has provided a straight forward option in rules setup to identify those mails which are auto forwarded, provided the document has a property called “Auto Forwarded”. (This you can verify by adding column of “Auto forwarded” by going to View Setting -> Columns and then selecting Auto forwarded — This will add a column with title “Auto Forwarded” and will show a tick mark for mails which are auto forwarded).
So, what now?
After digging for two days, I found a solution — By creating a script and assigning it to the rule.
Press Alt + F11 to open up the Visual basic editor, double click on ThisOutlookSession object, and create a procedure with following signature:
Public Sub YourProcName (Item As Outlook.MailItem) 'code End Sub
Now put following code in your procedure:
Public Sub MyAutoForwardRule(Item As Outlook.MailItem) Dim myNameSpace As Outlook.NameSpace Dim myInbox As Outlook.MAPIFolder Dim myDestFolder As Outlook.MAPIFolder Set myNameSpace = Application.GetNamespace("MAPI") Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) ' Assumes destination folder is directly under the Inbox Set myDestFolder = myInbox.Folders("AF_Mails") If Item.AutoForwarded Then 'move message Item.Move myDestFolder End If Set myDestFolder = Nothing Set myInbox = Nothing Set myNameSpace = Nothing End Sub
So, the programming part is over.
- Now create a new rule.
- Select “Apply rule on messages I receive” and click next
- Select “From people or public group”, and select the person who auto forwards you mails, click next
- Select “Run a script”. A box will appear with all public procedures in you VBA. Select procedure that you just created above.
- Save your rule