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

查看:164
本文介绍了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)或通过 自定义C#应用程序,它使用MailItemSend方法.

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天全站免登陆