Search code examples
c#outlookvstooutlook-addinoffice-addins

When does Outlook's Explorer.ActiveInlineResponse property return null?


I'm attempting to determine when Outlook's Explorer.ActiveInlineResponse property will return null. The documentation link states, "This property returns Null (Nothing in Visual Basic) if no inline response is visible in the Reading Pane".

So far I've only been able to get ActiveInlineResponse to return null when sending mail from outside of Outlook. For example, a Word/Excel mail merge or from a VBA project that uses Outlook to send mail. Are there any other instances where ActiveInlineResponse will return null? I'm only concerned with Outlook mailitems.

Here's my question in code-

        Outlook.Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
        explorer = Globals.ThisAddIn.Application.ActiveExplorer();
        Outlook.MailItem mailItem = Item as Outlook.MailItem;

        if (explorer.ActiveInlineResponse is Outlook.MailItem)
        {
            if (explorer.ActiveInlineResponse == null)
            {
                //When would the ActiveInlineResponse be null?
            }

            else if (explorer.ActiveInlineResponse != null)
            {
                //ActiveInlineResponse is not null when an item is being composed inline (reply,reply all or forward)
            }
        }

Thanks!


Solution

  • Of course - this is to be expected: Word/Excel etc. do not use inline response to send messages, they show messages in a separate inspector, which can be retrieved using Application.ActiveInspector.

    Inline response (Application.ActiveExplorer.ActiveInlineResponse) is only shown when a user replies to or forwards a message.