1
votes

I'm writing an Outlook 2016 VSTO Add-in in c# to add some lookup functionality. I already managed to create a context menu item when right clicking in an email body. The code in the handler accesses the current selection and executes my lookup functionality. So far so good.Screenshot of working context menu

Now I also would like to add an item to the context menu when right clicking on the email subject (in the reading pane above the body). Although looking in "Office2016FluentUserInterfaceControlIdentifiers" I couldn't find the idMso.

Question 1: What is the idMso of this context menu?

Next problem is here that it also seems difficult to access the current selection - the way via ActiveInspector.WordEditor.Application.Selection.Text or ActiveExplorer.Selection[1].GetInspector.WordEditor.Application.Selection.Text did work for the Email body but not for the subject above. Screenshot of selected text in subject

Question 2:How to access the current selection in the email subject?

Any help is appreciated.

1
What about using Explorers object and get a Selection explorer as mentioned hereEldar

1 Answers

0
votes

Preview pane body - use Explorer.ActiveInlineResponseWordEditor.
Subject edit box - the best you can do is use Windows API to find the control's HWND and then retrieve the selection using EM_GETSEL message.