HowTo: Show/Hide inspector pane per inspector instance

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

HowTo: Show/Hide inspector pane per inspector instance
 
Thanasis Boukouvalas




Posts: 40
Joined: 2006-06-17
Hi

I'd like the user can have as many (mail) inspectors opened and some of them have the ADXOlForm (botton pane) visible (based on a MailItem.UserProperty) and some others don't.

How can I do this?
Posted 22 Sep, 2006 07:15:06 Top
Fedor Shihantsov


Guest


Use the adxOlFormsManager.ADXNewInspector event.

private void adxOlFormsManager1_ADXNewInspector(object inspectorObj)
{
object currentItem = (inspectorObj as Outlook.Inspector).CurrentItem;
Outlook.MailItem mailItem = currentItem as Outlook.MailItem;
if (mailItem != null)
{
bool FormVisible;

//Define FormVisible

// prevents removing cashed forms
adxOlFormsManager1.LockUpdates();
if (FormVisible)
{
adxOlFormsManager1.Items[0].Enabled = true;
}
else
{
adxOlFormsManager1.Items[0].Enabled = false;
}
adxOlFormsManager1.UnlockUpdates();
Marshar.ReleaseComObject(mailItem);
}
}
Posted 22 Sep, 2006 08:03:29 Top