运行运行外部程序的VBA脚本的Outlook规则 [英] Outlook rule to run VBA script that runs external program

查看:201
本文介绍了运行运行外部程序的VBA脚本的Outlook规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个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.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆