Adding property page to Outlook 2000 and up using C#

P

Paul Keeley

How do you add a propery page to Outlook 2000 using C#? I tried adding the
event handler using the following code. It compiled fine but generated the
exception at the bottom.

try

{

applicationObject.OptionsPagesAdd += new
Outlook.ApplicationEvents_OptionsPagesAddEventHandler(this.OptionsPagesAdded
);

}

catch (Exception e)

{

System.Diagnostics.Debug.Write(e.ToString());

}


System.InvalidCastException: No such interface supported

at System.Runtime.InteropServices.UCOMIConnectionPoint.Advise(Object
pUnkSink, Int32& pdwCookie)

at
Outlook.ApplicationEvents_EventProvider.add_OptionsPagesAdd(ApplicationEvent
s_OptionsPagesAddEventHandler )

at
Outlook.ApplicationEvents_Event.add_OptionsPagesAdd(ApplicationEvents_Option
sPagesAddEventHandler )



Thanks,

Paul Keeley
 
T

Tom Rizzo [MSFT]

I don't think 2000 has Primary Interop Assemblies so you may want to check
the ILDASM for the imported Outlook Object Model DLL to make sure that the
event you're trying to register for is marked public not private.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top