How to detect other outlook events such as “Forward as attachment”, “Reply with Meeting”

六月ゝ 毕业季﹏ 提交于 2020-06-02 04:01:19

问题


Out of the box outlook provides the following:

((Outlook.ItemEvents_10_Event)this._mailItem).Reply += new Outlook.ItemEvents_10_ReplyEventHandler(MailItem_Reply);
((Outlook.ItemEvents_10_Event)this._mailItem).ReplyAll += new Outlook.ItemEvents_10_ReplyAllEventHandler(MailItem_ReplyAll);
((Outlook.ItemEvents_10_Event)this._mailItem).CustomAction += new Outlook.ItemEvents_10_CustomActionEventHandler(MailItem_CustomAction);
((Outlook.ItemEvents_10_Event)this._mailItem).Forward += new Outlook.ItemEvents_10_ForwardEventHandler(MailItem_Forward);

However, is there a way to detect other events such as:

  • Reply with Meeting
  • Forward as Attachment

回答1:


There are no specific events for those actions but the standard Reply and Forward events will still fire. You can also tell that they clicked those buttons by inspecting the item type or attachment in the newly created item.




回答2:


OOM exposes ForwardAsAttachment as an event with the dispid of 0x0000F618, it is just the type library does not expose it. "Reply with meeting" is 0x0000F5FD.

You can hook those events using IConnectionPointContainer / IConnectionPoint using raw COM - you can see the events firing in OutlookSpy: select an item, click Item button on the OutlookSpy toolbar, go to the Events tab, click "Forward As Attachment", see the event logged in "Events Log" list ta the bottom of the Item window.



来源:https://stackoverflow.com/questions/44475878/how-to-detect-other-outlook-events-such-as-forward-as-attachment-reply-with

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!