How to remove a form added to the forms manager?

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

How to remove a form added to the forms manager?
How to remove a form added to the forms manager? 
Pino Carafa




Posts: 162
Joined: 2016-09-28
Added a form to the AdxOlFormsManager and applied it to the inspector.

It is now shown every time I create a new Inspector.

At some point I want to get rid of it again, so I am guessing that I will need to invoke AdxOlFormsManager.Items.Remove

Is that all I need to do or do I need to invoke DeleteForm on the item I want to remove? Is there anything else I need to do?

Thanks....

Pino
Posted 28 Apr, 2022 07:28:33 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Pino,

You control the forms that ADXOlFormsManager creates in two ways.

You can create/update/delete an ADXOlFromsCollectionItem. Each item provides context-sensitivity properties and binds them with the type name of the ADXOlForm so that when the values of the properties match the current Outlook context, the manager creates an instance of the form and shows it. Note that "creates" may be "reuses the existing form" if we talk about Explorer-related forms and ADXOlFromsCollectionItem.Cached is set to NewInstanceForEachFolder (default) or OneInstanceForAllFolders. Answering to your question: Deleting an item also deletes all form instances it created.

You can also control the visibility of the form instances that the forms manager creates. That is, you can keep some or all instances invisible. To achieve this, you handle the ADXOlForm.ADXBeforeFormShow event and set ADXOlForm.Visible as required. To show/hide an existing form instance outside of that event, say in the Click event of a [Ribbon] button, you call ADXOlForm.Show() or ADXOlForm.Hide(). The instances are stored in the ADXOlFromsCollectionItem.Instances collection.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Apr, 2022 05:42:19 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
Excellent! Thanks for the info.
Posted 29 Apr, 2022 06:11:58 Top