Question to ADXOLFormsCollectionItem.FormInstances(index)

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

Question to ADXOLFormsCollectionItem.FormInstances(index)
 
Christian Havel




Posts: 181
Joined: 2010-12-30
Hi,

how can I get the index for AdxOlFormsCollectionItem.FormInstance(index) for the ActiveInspector?

Thanks,
Christian.
Posted 05 Dec, 2011 05:01:45 Top
Eugene Astafiev


Guest


Hi Christian,

Please use the following code for getting the currently visible form in the specified layout of the active inspector window:

foreach (AddinExpress.OL.ADXOlFormsCollectionItem item in adxOlFormsManager1.Items)
{
   if (item.InspectorLayout == AddinExpress.OL.ADXOlInspectorLayout.RightSubpane)
   {
       for (int i = 0; i < item.FormInstanceCount; i++)
       {
           AddinExpress.OL.ADXOlForm form = item.FormInstances(i);
           if (form.InspectorObj == OutlookApp.ActiveInspector())
           {
               if(form.Active)
                  form.Text = "Out text";
           }
       }
   }
}


It works like a charm on my PC. Does it work for you too?
Posted 05 Dec, 2011 05:58:23 Top
Christian Havel




Posts: 181
Joined: 2010-12-30
Hi Eugene,

it looks very good. Well, I have only the problem, that I have to access my AdxOlForm on opening a MailItem.
In the MailItem.Open event my AdxOlForm is still not created.
I did not find a "MailItem.OpenFinished" event. Do you have any idea, when the AdxOlForm is created?
Thanks,
Christian.
Posted 05 Dec, 2011 07:11:25 Top
Eugene Astafiev


Guest


Hi Christian,

In that case please consider using the ADXBeforeFormShow event handler of the AddinExpress.OL.ADXOlForm class instead. Is it what you are looking for?
Posted 05 Dec, 2011 07:50:20 Top
Christian Havel




Posts: 181
Joined: 2010-12-30
Hi Eugene,

yes, that?s it.
Thank you very much.
Ciao,
Christian.
Posted 06 Dec, 2011 02:20:46 Top