Command bar events handling in inspector for with ADX Extensions Form

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

Command bar events handling in inspector for with ADX Extensions Form
How to handle event or reference form in inspector from addinmodule 
Robert Schneider




Posts: 7
Joined: 2006-08-01
I have a button on a commandbar in an inspector window in outlook. I need to handle the button event for each inpector window that is open seperately to update information in a panel on the window using adx extensions for outlook. I either wish to handle the event on each instance of the form or reference back to the active inspector window, get a reference to the .Net class, and update a property on that current instance of the form. Is this possible? Are there any demos? Any help would be great.
Posted 01 Aug, 2006 20:14:58 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Robert.

To get a reference to the active inspector window you can use the following code:

private void adxCommandBarButton1_Click(object sender)
{
Outlook.Inspector inspector = null;
try
{
inspector = OutlookApp.ActiveInspector();
}
finally
{
if (inspector != null)
Marshal.ReleaseComObject(inspector);
}
}
Posted 02 Aug, 2006 17:31:45 Top
Robert Schneider




Posts: 7
Joined: 2006-08-01
Ok, that finds the inpector but what about the ADX Extension panel on the inspector?
Posted 05 Aug, 2006 12:14:22 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Robert.

Please try the following code:

private void adxCommandBarButton1_Click(object sender)
{
Outlook.Inspector insp = null;
try
{
insp = OutlookApp.ActiveInspector();
ADXOlForm1 f = adxOlFormsManager1.CurrentForm as ADXOlForm1;
if (f != null)
{
f.MyTextBox.Text = insp.Caption;
}
}
finally
{
if (insp != null)
Marshal.ReleaseComObject(insp);
}
}
Posted 07 Aug, 2006 19:31:30 Top