Re: RDO objects and C#
- From: "Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx>
- Date: Mon, 8 Oct 2007 16:22:02 -0400
I've had no problems doing it this way:
RDOSession session = new RDOSession();
session.Logon("", "", false, false, null, false);
RDOFolder folder =
session.GetDefaultFolder(rdoDefaultFolders.olFolderContacts);
RDOMail item = folder.Items.Add("IPM.Contact");
RDOContactItem contact = (RDOContactItem)item;
More often I'd do it this way:
RDOContactItem contact = (RDOContactItem)folder.Items.Add("IPM.Contact");
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
<dskwarek@xxxxxxxxx> wrote in message news:1191859519.710607.63880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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 ?
.
- Follow-Ups:
- Re: RDO objects and C#
- From: dskwarek
- Re: RDO objects and C#
- References:
- RDO objects and C#
- From: dskwarek
- RDO objects and C#
- Prev by Date: RDO objects and C#
- Next by Date: Re: RDO objects and C#
- Previous by thread: RDO objects and C#
- Next by thread: Re: RDO objects and C#
- Index(es):
Relevant Pages
|
Loading