RDO objects and C#



I'm testing Outlook Redemption component (4.4.0.714) with C# project.

I have problem with creating of RDO instances.

I'm using Visual Studio 2005.
I added Redemption component to my project using
AddReference -> COM -> Redemption Outlook Library 4.4.

I tried to create instance of RDOContactItemClass.

RDOSessionClass session = new RDOSessionClass();
session.Logon("", "", false, false, null, false);
RDOFolder folder =
session.GetDefaultFolder(rdoDefaultFolders.olFolderContacts);
IRDOMail item = folder.Items.Add("IPM.Contact");

RDOContactItem contact = item as RDOContactItem; // NULL !!!


Method Items.Add returns instance which implements RDOMail interface.
I've found in Outlook Redemption documentation that RDOContactItem is
derived from the RDOMail object.

There isn't true for interop assembly created by Visual Studio.

RDOContactItem is interface and implements IRDOContactItem which
implements IRDOMail.

Visual Studio creates RDOContactItemClass which implements
RDOContactItem and IRDOContactItem.


There is no RDOMail in inheritance hierarchy of RDOContactItem.

How to add new instance of RDOContactItemClass to RDOItems collection
?

Using Items.Add method I can create only instance of RDOMailClass.

What am I doing wrong ?

.



Relevant Pages

  • Re: RDO objects and C#
    ... I've always generally used a RDOMail item instead of the class version except where I need to add event handlers that aren't in the non-class version. ... RDOContactItem works and your example also. ... than overrides cast operators. ...
    (microsoft.public.outlook.interop)
  • Re: RDO objects and C#
    ... RDOSession session = new RDOSession; ... RDOFolder folder = ... RDOContactItem contact = folder.Items.Add; ... Method Items.Add returns instance which implements RDOMail interface. ...
    (microsoft.public.outlook.interop)

Loading