PC Review


Reply
Thread Tools Rate Thread

Adding property page to Outlook 2000 and up using C#

 
 
Paul Keeley
Guest
Posts: n/a
 
      31st Dec 2003
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



 
Reply With Quote
 
 
 
 
Tom Rizzo [MSFT]
Guest
Posts: n/a
 
      31st Dec 2003
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

--
Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint? Check out http://www.microsoft.com/MSPress/books/5517.asp

This posting is provided "AS IS" with no warranties, and confers no rights.



"Paul Keeley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make an Outlook Add-In with VB.NET? (with property page) DraguVaso Microsoft Dot NET 4 19th Apr 2005 08:48 AM
Adding code property to control property window NuBBeR Microsoft C# .NET 1 7th Oct 2004 05:15 PM
Adding a .pdf document to a web page with FrontPage 2000 Todd Michaels Microsoft Frontpage 3 25th Jan 2004 09:29 AM
[Outlook Automation]Adding user property to contact item Marcel Stör Microsoft C# .NET 0 19th Sep 2003 11:00 AM
Adding property page to Outlook Tools/Options Sunny Microsoft Outlook Program Addins 1 5th Aug 2003 02:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 AM.