I have some C# automation code which does interesting things with Microsoft.Office.Interop.Word.Document objects. The ActiveInspector().WordEditor created via
Document doc = Globals.ThisAddin.Application.ActiveInspector().WordEditor;
in a VSTO Outlook addin produces a similar Document object which I’m able to use with my existing application. I can get the WordEditor when there is an editable mail item (i.e. New message or Reply for example). Can I get a WordEditor on an mail item in the inbox, for example?
Edit —
Further investigation has lead me to the following:
Object selObject = Globals.ThisAddIn.Application.ActiveExplorer().Selection[1];
if (selObject is Outlook.MailItem)
{
Outlook.MailItem mailItem = (selObject as Outlook.MailItem);
Document doc = mailItem.GetInspector.WordEditor;
}
Thanks to Paul-Jan for getting me on the right track
No. Neither your question title nor the content makes much sense, really.
The active inspector is the view on a single item in Outlook. As those items are often MailItems, that can be edited with Word, there is a Word Editor property you can access to use it.
The active explorer is the view on the folder contents. There is no single item, nor is there a word editor. It’s a completely different concept from an inspector. It’s one versus many. It’s detail versus master. You get the point.
Hope that clears things up a little.