Outlook rule to run VBA script to pass the body of email to external program Outlook rule to run VBA script to pass the body of email to external program shell shell

Outlook rule to run VBA script to pass the body of email to external program


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.SubjectEnd Sub`Sub CustomMeetingRequestRule(Item As Outlook.MeetingItem)    MsgBox "Meeting request arrived: " & Item.SubjectEnd Sub


You'd need a VBA script to parse python in outlook.

Press alt+F11. You will get a VBA window.

Sub python(Item As Outlook.MailItem)Shell ("python C:\path\tp\your\filename.py")End Sub

I hope you have set windows variable path for python.

Shell command passes the command to windows shell prompt. You can test this by running your python script in command prompt. If it is working there, then it should work here as well.