问题
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