Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: nameSpace.OptionsPagesAdd

Geek News

nameSpace.OptionsPagesAdd
Ralf Jansen <Ralf.Jansen[ at ]Schoenmackers.de> 5/11/2006 7:36:58 PM
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_OptionsPagesAddEventHandler(nameSpace_OptionsPagesAdd);
}

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


Ralf
Re: nameSpace.OptionsPagesAdd
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 5/12/2006 1:29:21 PM
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" <Ralf.Jansen[ at ]Schoenmackers.de> wrote in message
news:unWCmKTdGHA.5016[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
> 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_OptionsPagesAddEventHandler(nameSpace_OptionsPagesAdd);
> }
>
> private void
> nameSpace_OptionsPagesAdd(Microsoft.Office.Interop.Outlook.PropertyPages
> Pages, Microsoft.Office.Interop.Outlook.MAPIFolder Folder)
> {
> Pages.Add(_mailStoreFolderPropertyPage, "MailStore");
> }
>
>
> Ralf

Re: nameSpace.OptionsPagesAdd
Ralf Jansen <Ralf.Jansen[ at ]Schoenmackers.de> 5/12/2006 2:01:50 PM
Indeed that was the problem. Thanks Ken.

Ralf

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net