Persisting Options Page

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

Persisting Options Page
How do I persist an options page settings 
Alex Abramov




Posts: 34
Joined: 2006-09-15
Hello,
In my ADX project I have an options page which appears an expected in Outlook/Tools/Options.

Howevever, setting changes only work for the current session, and on the next restart go to defaults. How do I persist those settings?

Also, the Apply button is never lit when I change anything.

Thanks,

Alex
Posted 12 Oct, 2006 11:24:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Alex.

You can save your settings to a file or the system registry. It's up to you. Then you can load settings in the Load event handler of the property page.

Do you use the OnStatusChange() method to activate the Apply button?
Please look at the OutlookPropertyPage example from the ADX installation package to learn how it works.
Posted 12 Oct, 2006 15:55:23 Top
Alex Abramov




Posts: 34
Joined: 2006-09-15
Ok,
In that case, if I want to save it to a file, were would the system place the file? (if I don't specify anything by its name?)

Also, if I want to place the file into the install folder, how do I access that info?

Since the Options page loads a separate instance of the Addin, does it make sense to subscribe to its Apply event to read new values into a global Settings table that I use to keep track of those settings?

Thanks,

Alex
Posted 13 Oct, 2006 17:28:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Alex.

You can use the Assembly.GetExecutingAssembly().Codebase property to obtain the add-in installation folder from the addinmodule.
The Options Page doesn't load a separate instance of the add-in. Please download the example below to learn how you can create the Options Page in the same application domain with the add-in:
http://www.add-in-express.com/projects/olnewpropertypage.zip
Posted 16 Oct, 2006 08:09:47 Top