Outlook - Highlight mail in explorer view RRS feed

  • Question

  • Hi!

    I'm developping an Outlook 2010 AddIn. 

    I have a user control in a custom task pane in which the user can  trigger an action to highlight words in the selected MailItem (on the explorer window) matching a specific criteria. 

    I know I can access the Document using  


    and then I can use the Find object like:

    Find find=Doc.Content.Find;

    find.HitHighlight(textToHighlight, WdColor.wdColorYellow, Type.Missing, false, true);

    I have this working in Inspector windows as I expected, but In Explorer window , the Find.Found property is true, but the text isn't highlighted...

    Furthermore if I open the selected MailItem in a new Inspector window the text is highlighted even if the action comes from the Explorer Usercontrol...

    I understand this behavior because the GetInspector method returns a "virtual" inspector window which the user can't see.

    So, my question is, how can I access the WordEditor of the selected message directly, in order to have the highlight working...

    Thanks in advance,


    Tuesday, June 5, 2012 3:03 PM


All replies