Referencing particular instance of Outlook inspector sub pane

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

Referencing particular instance of Outlook inspector sub pane
Toggling visibility of ADXOlForm on Outlook Inspector 
BR Diamond

Posts: 23
Joined: 2007-04-18

Our addin has a ADXOlForm that displays only in the inspector for new mail items. If we create several new emails at the same time, a new instance of this ADXOlForm is created for every NewMail inspector. This is fine and just as we want. But we need to be able to toggle the form of the Active Inspector on and off using a Keyboard Shortcut. (Active Inspector only and not the other new mail inspectors.)

We can make the ADXOlForm invisible on the Active Inspector okay (using code below) but restoring the ADXOlForm on the Active Inspector only doesn't work because the ADXOlFormManager1.Items(0).FormInstances(iLoop).Active line is not true if the ADXOlForm is invisible. Obviously, if we put an 'Else' in the first 'If' statement, all the other instances will be affected.

So the question is this:
Is there a good way to access the ADXOlForm instance on the Active Inspector? The looping method as below seems pretty limited (unless I'm missing a more useful property than .Active)


The following is code for AdxKeyboardShortcut1_Action:

Dim iLoop As Integer
For iLoop = 0 To ADXOlFormManager1.Items(0).FormInstanceCount - 1
If ADXOlFormManager1.Items(0).FormInstances(iLoop).Active = True Then
If ADXOlFormManager1.Items(0).FormInstances(iLoop).Visible = True Then
ADXOlFormManager1.Items(0).FormInstances(iLoop).Visible = False
ADXOlFormManager1.Items(0).FormInstances(iLoop).Visible = True
End If
Exit For
End If

Really appreciate any input



Posted 18 Apr, 2007 08:34:18 Top
Fedor Shihantsov



In the latest premium build we added ADXOlForm.CurrentOutlookWindowHandle property that should help in this task.
You can use an Outlook window handle to identify ADXOlForm.
Idea is get ActiveInspector window handle and compare with ADXOlForm.CurrentOutlookWindowHandle.

See the following example:

Note: The public release that contains the CurrentOutlookWindowHandle property is planned for the firsh half of May.
Posted 18 Apr, 2007 11:24:50 Top
BR Diamond

Posts: 23
Joined: 2007-04-18

Hi Fedor,

Thanks very much. Got everything I needed from the example program (plus a whole lot more information and hints as well).

Thanks for the great support.

Posted 18 Apr, 2007 18:41:25 Top