Processin reply, forward, and resend

Add-in Express™ Support Service
That's what is more important than anything else

Processin reply, forward, and resend
 
Fabrice




Posts: 135
Joined: 2010-12-13
I've been reported that sometime userproperty found in an email is copied by Outlook to the response or forward email. Did you already had this ? I cannot reproduce it locally, it happen on customer laptop.

Anyway, I'm now trying to handle the reply/forward in all possible way, so that I can remove all our custom properties, and I found your (very useful!) blog posts:

- https://www.add-in-express.com/creating-addins-blog/2011/12/08/handle-outlook-item-reply-event/
- https://www.add-in-express.com/creating-addins-blog/2011/12/13/outlook-item-reply-inspector-activate/
- https://www.add-in-express.com/creating-addins-blog/2011/12/14/outlook-reply-event-context-menu/

I've a couple of question:

- Do I need to only have one ADXOutlookItemEvents ? Suppose this scenario: I connect to the explorer active item. User right click on another mail, I reconnect to this mail. But in the explorer the mail is still active and user can reply to it. Does-it means that I need 3 ADXOutlookItemEvents objects (1 for explorer, 1 for inspector activate, and 1 for context menu) ?

- How could I catch the "resend" action ? Because this action is like a forward, except that it's the original mail that get opened in edit mode, and will be send.

- The post to catch the reply via right click event seems outdated, as it seems to not work anymore in Outlook 2016 (we must support from 2010). I registered to the 'ItemContextMenuDisplay' event but this event is not triggered. Is it another way to do it ?

Thank you for your help
Fabrice
-------------
Posted 05 Dec, 2018 12:46:26 Top
Andrei Smolin


Add-in Express team


Posts: 16198
Joined: 2006-05-11
Hello Fabrice,

Unfortunately, that series of blogs doesn't cover getting an email that is right-clicked in Outlook 2013+: the ItemContextMenuDisplay event doesn't work in these Outlook versions.

You need to add an invisible button to that Ribbon context menu(s) and handle the button's PropertyChanging event. When Outlook asks for a property - say, for the Visible property - of that button, i.e. if e.PropertyType is ADXRibbonControlPropertyType.Visible, you get e.Context - note that this call creates a COM object that you need to release - and cast it to Outlook.Selection; if the result is not null (Nothing in VB.NET), you retrieve the items; if several items exist, the user cannot click Reply or ReplyAll. Remember that Selection.Item(index) or Selection[index] creates a COM object which you need to release after use.

Also, you would need to test using Quick Steps to reply, reply all, forward, reply with meeting, and forward as attachment. I haven't checked these.

Fabrice writes:
- Do I need to only have one ADXOutlookItemEvents ?


You can use a single ADXOutlookItemEvents if you are after Reply/ReplyAll; handling Forward may requires using a list/dictionary of ADXOutlookItemEvents objects. When you close the context menu, Outlook raises the Explorer.Activate event; it is mapped to ADXOutlookAppEvents.ExplorerActivate event. So, when that event occurs you connect to selected items.

Fabrice writes:
How could I catch the "resend" action


This is a button, IdMso=ResendThisMessage. Use this info to setup an ADXRibbonCommand component intercepting clicking that button.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Dec, 2018 07:08:22 Top