views:

175

answers:

1

I've set up an Outlook rule that filters for the emails I care about. The action I want to take is to run an external program (python script) to parse each such email. Can someone advise on how to do this? I know of the SHELL function, but I need a way to pass the body of the email to my external program.

I have zero experience with VBA so details/code-snippets would be much appreciated.

A: 

Google is your friend for this one, I got this snippet by searching "outlook vba script".

Basically for the body of the email you want to pass Item.Body to your python script.

http://support.microsoft.com/kb/306108

Sub CustomMailMessageRule(Item As Outlook.MailItem) MsgBox "Mail message arrived: " & Item.Subject End Sub`

Sub CustomMeetingRequestRule(Item As Outlook.MeetingItem) MsgBox "Meeting request arrived: " & Item.Subject End Sub

wonderfulthunk
Thanks that was helpful.
dshin