To setup macro script for Rule to call.
-
- Press Alt+F11 in Outlook
- VBA code screen will be prompted.
- Select Project1 -> Microsoft Outlook Objects -> ThisOutlookSession
- Create subroutine with
Public Sub Routine_name(Item As Outlook.MailItem) as signature
- Then you can found this subroutine in Rule window.
This example remove attachment and forward to someone.
Public Sub ForwardToAntony(Item As Outlook.MailItem) Dim objForwardedItem As MailItem Set objForwardedItem = Item.Forward Do Until objForwardedItem.Attachments.Count = 0 objForwardedItem.Attachments.Remove (1) Loop objForwardedItem.To = "this_is@email.com" objForwardedItem.Send End Sub