Skip to content

Instantly share code, notes, and snippets.

@litan1106
Last active August 29, 2015 14:15
Show Gist options
  • Save litan1106/e78774653f62a2781370 to your computer and use it in GitHub Desktop.
Save litan1106/e78774653f62a2781370 to your computer and use it in GitHub Desktop.
PrintMail:Outlook
Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
MsgBox msg.HTMLBody
Set msg = Nothing
Set olNS = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment