Outlook规则运行VBA脚本以将电子邮件正文传递给外部程序

dsh*_*hin 6 email shell outlook vba rule

我已经设置了一个过滤电子邮件的Outlook规则.我想运行一个外部程序(python脚本)来解析每个这样的电子邮件.

我知道SHELL功能,但我需要一种方法将电子邮件的正文传递给我的外部程序.

won*_*unk 6

谷歌是你的朋友,我通过搜索"outlook vba script"获得了这个片段.

基本上,您想要将Item.Body传递给您的python脚本的电子邮件正文.

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
Run Code Online (Sandbox Code Playgroud)