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
Else
ADXOlFormManager1.Items(0).FormInstances(iLoop).Visible = True
End If
Exit For
End If
Next
Really appreciate any input
Thanks
BRD
|
|
Fedor Shihantsov
Guest
|
Hi,
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:
http://www.add-in-express.com/projects/adx-x-ol-3-vb-active_inspector_form.zip
Note: The public release that contains the CurrentOutlookWindowHandle property is planned for the firsh half of May. |
|
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.
BRD :D
|
|