运行VBA脚本以将电子邮件正文传递给外部程序的Outlook规则 [英] Outlook rule to run VBA script to pass the body of email to external program
本文介绍了运行VBA脚本以将电子邮件正文传递给外部程序的Outlook规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经设置了一个过滤电子邮件的Outlook规则.我想运行一个外部程序(python脚本)来解析每一封这样的电子邮件.
I've set up an Outlook rule that filters emails. I want to run an external program (python script) to parse each such email.
我知道SHELL函数,但是我需要一种将电子邮件正文传递给我的外部程序的方法.
I know of the SHELL function, but I need a way to pass the body of the email to my external program.
推荐答案
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.
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
这篇关于运行VBA脚本以将电子邮件正文传递给外部程序的Outlook规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文