Show/Hide Panel (ADX Extensions for Outlook)

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

Show/Hide Panel (ADX Extensions for Outlook)
mitchel c

Posts: 20
Joined: 2006-05-07
How can I show/hide a panel from the Selection change event? I want to only show it for some mail items based on a special header...

Posted 04 Jun, 2006 02:24:27 Top
Fedor Shihantsov



Please, add Events (AddinExpress.MSO.ADXOutlookAppEvents) component to AddinModule.
And use the following code in ExplorerSelectionChange handler.

private void adxOutlookEvents_ExplorerSelectionChange(object sender, object explorer)
    Outlook.Selection selection = null;
    Outlook.MailItem mailItem = null;
        selection = (explorer as Outlook.Explorer).Selection;
        if (selection.Count == 1)
            if (selection[1] is Outlook.MailItem)
                mailItem = selection[1] as Outlook.MailItem;
                adxOlFormsManager1.Items[0].Enabled = (mailItem.Subject == "MySubject");
        if (selection != null)
        if (mailItem != null)

Note, this will result in creation of a new form instance for every SelectionChange event. So, you need to keep your data (if any) somewhere else.
Posted 05 Jun, 2006 08:03:19 Top