ItemSend 事件未触发 [英] ItemSend event is not firing

查看:30
本文介绍了ItemSend 事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Outlook 2007 加载项 (VSTO).任何使用 Outlook 发送的邮件都应在此之前进行修改.

I have an Outlook 2007 Add-in (VSTO). Any mail sent with Outlook should be modified before that.

我使用 Application.ItemSend 事件,如果我直接从 Outlook (Inspector) 或通过使用 MailItemSend 方法的自定义 C# 应用程序.

I use the Application.ItemSend event and it works fine if I send an email directly from Outlook (Inspector) or through a custom C# application that uses the Send method of the MailItem.

但是,有一些外部应用程序使用 Outlook 发送邮件 - 根本不会触发 ItemSend 事件.邮件被直接移动到发件箱(我什至可以捕捉到该文件夹​​上的 ItemAdd 事件)然后发送.

However, there is some external application that uses Outlook to send mails - which does not trigger the ItemSend event at all. The mail is moved directly to the Outbox (I can even catch the event of ItemAdd on that folder) and then sent.

另一个有趣的问题是,如果我定义了延迟递送规则,那么如果我使用 Inspector 或我的 c# 代码发送邮件,它就可以正常工作,但在此应用程序中则不行做到了.

Another interesting issue is that if I define a deferred delivery rule it works OK if I send a mail with the Inspector or my c# code, but not when this application does it.

我的问题是何时以及如何创建通过 ItemSend 事件的消息?

My question is when and how can you create a message that passes the ItemSend event?

推荐答案

这是设计使然:由 Simple MAPI 或 mailto url 创建和发送的消息不会触发 OOM 事件.这是故意完成的 - 在那些场景中存在一些问题,因此事件被完全禁用.

This is by design: messages created and sent by Simple MAPI or mailto url do not trigger OOM events. This is done on purpose - there were some problems in those scenarios, so events were completely disabled.

这篇关于ItemSend 事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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