Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   nameSpace.OptionsPagesAdd (http://www.outlookbanter.com/add-ins-outlook/14467-namespace-optionspagesadd.html)

Ralf Jansen May 11th 06 09:36 PM

nameSpace.OptionsPagesAdd
 
I'm trying to handle the nameSpace.OptionsPagesAdd event to show a custom property page for a
folder. see code below.
Problem may eventhandler is only called the first time i open the option dialog for a folder and
then never again as if my EventHandler has been detached.
What did i miss?


private void ThisApplication_Startup(object sender, System.EventArgs e)
{
Outlook.NameSpace nameSpace = this.GetNamespace("MAPI");
nameSpace.OptionsPagesAdd += new
Outlook.NameSpaceEvents_OptionsPagesAddEventHandle r(nameSpace_OptionsPagesAdd);
}

private void nameSpace_OptionsPagesAdd(Microsoft.Office.Interop .Outlook.PropertyPages
Pages, Microsoft.Office.Interop.Outlook.MAPIFolder Folder)
{
Pages.Add(_mailStoreFolderPropertyPage, "MailStore");
}


Ralf

Ken Slovak - [MVP - Outlook] May 12th 06 03:29 PM

nameSpace.OptionsPagesAdd
 
Make sure you set and keep a reference to NameSpace, perhaps in a hash table
or something like that so it isn't garbage collected.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ralf Jansen" wrote in message
...
I'm trying to handle the nameSpace.OptionsPagesAdd event to show a custom
property page for a folder. see code below.
Problem may eventhandler is only called the first time i open the option
dialog for a folder and then never again as if my EventHandler has been
detached.
What did i miss?


private void ThisApplication_Startup(object sender,
System.EventArgs e)
{
Outlook.NameSpace nameSpace = this.GetNamespace("MAPI");
nameSpace.OptionsPagesAdd += new
Outlook.NameSpaceEvents_OptionsPagesAddEventHandle r(nameSpace_OptionsPagesAdd);
}

private void
nameSpace_OptionsPagesAdd(Microsoft.Office.Interop .Outlook.PropertyPages
Pages, Microsoft.Office.Interop.Outlook.MAPIFolder Folder)
{
Pages.Add(_mailStoreFolderPropertyPage, "MailStore");
}


Ralf



Ralf Jansen May 12th 06 04:01 PM

nameSpace.OptionsPagesAdd
 
Indeed that was the problem. Thanks Ken.

Ralf


All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com