Advertisement
gn4711

Outlook Rule for MailItem Work

Dec 9th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Starting with Outlook 2002, you can call a VBA subroutine from a Rules Wizard rule using the "run a script" rule action.
  2.  
  3. Sub ConvertToPlain(MyMail As MailItem)
  4.     Dim strID As String
  5.     Dim objMail As Outlook.MailItem
  6.    
  7.     strID = MyMail.EntryID
  8.     Set objMail = Application.Session.GetItemFromID(strID)
  9.     objMail.BodyFormat = olFormatPlain
  10.     objMail.Save
  11.    
  12.     Set objMail = Nothing
  13. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement