问题描述
我已经设置了一个Outlook规则,用于过滤我关心的电子邮件。我想要采取的行动是运行一个外部程序(python脚本)来解析每个这样的电子邮件。有人可以建议如何做到这一点吗?我知道SHELL功能,但我需要一种方式将电子邮件的身份传递给我的外部程序。
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.
我没有VBA的经验,所以细节/代码 -
I have zero experience with VBA so details/code-snippets would be much appreciated.
推荐答案
Google是您的朋友,我通过搜索outlook vba脚本获得了这个代码段。
Google is your friend for this one, I got this snippet by searching "outlook vba script".
基本上,您要将Item.Body传递给您的python脚本的电子邮件正文。
Basically for the body of the email you want to pass Item.Body to your python script.
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
这篇关于运行运行外部程序的VBA脚本的Outlook规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!