In a region, how to get selected explorer/inspector

Add-in Express™ Support Service
That's what is more important than anything else

In a region, how to get selected explorer/inspector
 
Luc Pasmans




Posts: 1
Joined: 2022-04-21
Currently I am using a region that is only available in read-only inspector/explorer windows.

 public partial class MailReadRegion : AddinExpress.OL.ADXOlForm
    {
        public SimplifiedWrapperItemReadObject MailItem;

        public MailReadRegion()
        {
            InitializeComponent();

            this.ADXSelectionChange += MailReadRegion_ADXSelectionChange;
        }

        private void MailReadRegion_ADXSelectionChange()
        {
            var mailitem = this.ExplorerObj == null ? (this.InspectorObj as Inspector).CurrentItem : (this.ExplorerObj as Explorer).ActiveInlineResponse;

            if (mailitem == null)
                return; //at start-up mailitem is empty! <<<< always triggers now

            MailItem = ConvertReadObject.ToSimplified(new OutlookWrapperItem(mailitem));
        }

    }


I was hoping that the ADXSelectionChange would give me the currently selected/opened MailItem. The code however returns in all instances a NULL, e.g. if I open it in explorer ActiveInlineResponse is NULL. The ActiveInlineResponseWordEditor gives the error 'Exception has been thrown by the target of an invocation.', same goes for the HTMLDocument.
Posted 21 Apr, 2022 01:42:14 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Luc,

What do you need to get: the selected item(s) or the active inline response?

You get the latter via Explorer.ActiveInlineResponse, which is correct but why do you do this in the SelectionChange event? There's the Explorer.InlineResponse event to get the item when inline response opens.

And why do you get an inspector in the SelectionChange event? Could you please provide more details?

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 26 Apr, 2022 11:47:06 Top