挂钩 Outlook 联系人的发送/接收同步事件
如何使用 VSTO AddIn 为 Outlook 2007 中的联系人文件夹/联系人项目的 SendAndReceive
事件附加事件处理程序? 我尝试使用:
Application.ActiveExplorer().SyncObjects.ForEach
{
SyncObject.SyncEnd += \\Do something
}
但它不起作用。
How can I attach an event handler for SendAndReceive
event of Contact folders/Contact Items in Outlook 2007 using VSTO AddIn? I tried using:
Application.ActiveExplorer().SyncObjects.ForEach
{
SyncObject.SyncEnd += \\Do something
}
But it is not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我尝试过
此挂钩来发送/接收所有默认文件夹。
I tried
This hooks on to send/receive of all default folders..
实际上我的需求有点不同,但可能是相同的:
我想在发送/接收后收到文件夹更改(我的情况是约会)的通知。
我的第一个想法(我认为您在同一轨道上)是检查发送/接收事件,也许从中获取一些项目集合或类似的东西,但没有这样的东西可用。 (正如 中所述此论坛帖子)
我的第二条路径来自 以下文章:我可以注册文件夹的
Item_Add
和Item_Change
(甚至Item_Removed
)事件(它们是也由发送接收所做的更改触发):一些代码:
Actually my need was a bit different but may be the same:
I wanted to be notified of the changes of a folder (appointments in my case) after a send/receive.
My first thought (and I think you are on the same track) was to check for a send/receive event and maybe get some collection of items out of it or something similar, but no such thing is available. (as is also explained in this forum post)
My second path came from the following article: I can register to the
Item_Add
andItem_Change
(and evenItem_Removed
) event of a folder (whom are also triggered by the changes done by a send receive):Some code:
您可以挂接邮件发送/接收事件,然后检查邮件类型是否为 ContactItem。 这是发送事件的示例。
然后在您的事件处理程序中检查邮件项目类型;
You can hook up the mail send/receive event and then check that the mail type is a ContactItem. Here is an example of the Send event.
then in your event handler you check the mail item type;
就我而言,我需要在收到新电子邮件后触发一个事件 电子邮件同步后,以便我收到新电子邮件,否则我将不会收到新电子邮件附件。
下面我的解决方案可能会对您有所帮助。
In my case, I need to trigger an event after a new email is received & after email sync so that I get a new email, or else I will not receive a new email attachment.
Below my solution may help you.