Get adxOlFormsCollectionItem1 object in an OutlookItemEvents class

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

Get adxOlFormsCollectionItem1 object in an OutlookItemEvents class
How to get an adxOlFormsCollectionItem1 object in an OutlookItemEvents class  
Jock Hartvig Andersen




Posts: 2
Joined: 2017-08-16
The code
AddinExpress.OL.ADXOlForm myOlForm;
myOlForm = adxOlFormsCollectionItem1.GetCurrentForm(AddinExpress.OL.EmbeddedFormStates.Active);
works fine in the AddinModule class.

But I want to use it in an OutlookItemEvents class to update data on a region form.

VS say that "The name adxOlFormsCollectionItem1 does not exist in current context".
I need get an object, but how to do that?

I have searched/googled, but until now not found a solution.

regards Jock
Posted 16 Aug, 2017 02:23:23 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Jock,

In the AddinModule designer, you need to make adxOlFormsCollectionItem1 internal instead of private - choose it in the Properties window and change the Modifiers property. Then, in your OutlookItemEvents class, you can use the CurrentInstance property of the AddinModule as follows:

AddinModule.CurrentInstance.adxOlFormsCollectionItem1.GetCurrentForm(AddinExpress.OL.EmbeddedFormStates.Active);
Posted 16 Aug, 2017 04:22:47 Top
Jock Hartvig Andersen




Posts: 2
Joined: 2017-08-16
Thanks, that worked.

IN VS I get green sqickels saying GetCurrentForm with parameter is obsolete.

Instead I use:
AddinModule.CurrentInstance.adxOlFormsCollectionItem1.GetCurrentForm();
Posted 16 Aug, 2017 10:34:36 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Hi Jock,

Thank you for keeping us informed.

Instead I use: AddinModule.CurrentInstance.adxOlFormsCollectionItem1.GetCurrentForm();


Everything is correct, you can use this method without parameters.
Posted 16 Aug, 2017 10:42:38 Top