How to determine which verb invoked the new Inspector?

D

DRuben

I am creating a C++ COM add-in to work on Outlook 2003 and 2007 using
strictly the Outlook Object model. I am monitoring Explorer, Inspectors (New
Inspector) and selected item events (verbs: Open, Reply, ReplyAll, Forward).
As long as the user selects the item before selecting an action on it
(causing a SelectionChange event to fire, which allows me to sink with the
item events), I'm able track the last verb based on the event fired. However,
if the user does not select the item first (it is not the currently selected
item) and instead right clicks the item, a SelectionChange event does not get
fired. What I do get is a New inspector event. At this point, how do I
determine which verb invoked the new Inspector for that item?

Thanks in advance for any and all help.
 
K

Ken Slovak - [MVP - Outlook]

To my knowledge you can't, unless you can find the original item and look at
the PR_LAST_VERB_EXECUTED (0x10810003, a PT_LONG) MAPI property, which would
have values like EXCHIVERB_REPLYTOSENDER and so on. That's not available
from the Outlook object model. You'd have to use an alternate API such as
Extended MAPI or CDO 1.21 or a MAPI wrapper such as Redemption
(www.dimastr.com/redemption) to work with that property.

In Outlook 2007 you could use the PropertyAccessor to access
PR_LAST_VERB_EXECUTED, but not in Outlook 2003. Again in Outlook 2007 you
could use the Application.ItemContextMenuDisplay event, which passes the
CommandBar and Selection for what was right-clicked but I'm not sure you
could subscribe to events on items in that Selection before the selection
was made, that would have to be tested.

In any case, for Outlook 2003 I don't know how you'd do what you want.
 
D

DRuben

Thanks for your help Ken. I will discuss this with our group and maybe we
will just not support it in 2003.

Darlene
 
D

DRuben

I'm taking look at Redemption now and will present it as a possible solution
for 2003.

Thanks again,
Darlene
 
K

Ken Slovak - [MVP - Outlook]

That's what I use if I need to support multiple versions of Outlook, plus
Redemption doesn't have the limitations that are there in PropertyAccessor
since it falls back to an IStream to read data if the Exchange limit is
passed on data size. PropertyAccessor will just truncate the data and not
fall back to an IStream, among some other disadvantages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top