Groups | Blog | Home
all groups > dotnet interop > april 2006 >

dotnet interop : Outlook COM object in C#


Andy
4/25/2006 12:31:09 PM
Are you going thru com interop yourself, or are you using the Office2k3
primary interop assemblies?

You should be using the latter. If you are using them... not sure what
the problem would be.
Alvin Bruney
4/25/2006 3:54:43 PM
can you extract an error code or further details, maybe a stack dump?

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

[quoted text, click to view]

Bruno Windels
4/25/2006 5:04:30 PM
Hi,

I am developping an application in C# that creates outlook contacts from
a database. For the outlook part of the application, I use the outlook
COM object (Version 11 from Office 2003). If a contact is already
present in the outlook contact
database, it should be updated. Therefore I store the outlook EntryID
when adding a contact in outlook in the corresponding database record.

When adding a contact to outlook, I first check if I can get the contact
from outlook by it's EntryID (to update it instead of adding) using
Namespace.GetItemFromID. This is where the problem lies.

On the machine that I develop the software, everything works fine.
Outlook isn't used for anything but testing the application so no email
account is configured.

On another machine Namespace.GetItemFromID always throws a COMException
with the message "Clientoperation failed", no mather if the contact
exists or not. Adding a new contact with Application.CreateItem works.

The major difference that I can see between the two machines is that the
latter is configured to use exchange for sharing folders includig the
contact folder I want to add the contacts in. I have tried playing with
the permissions of the default and anonymous user, as well as the user I
log in with but it doesn't change a thing.

All help would be very welcome.

Bruno Windels
4/25/2006 8:46:15 PM
I am using the Office PIA's

"Andy" <ajj3085@alum.rit.edu> schreef in bericht
news:1145993469.805209.247280@u72g2000cwu.googlegroups.com...
[quoted text, click to view]

Bruno Windels
4/25/2006 8:47:22 PM
Can't check right now, but IIRC no. The COMException is thrown by
getItemFromID, that is all the stack trace says ... IIRC

"Alvin Bruney" <www.lulu.com/owc> schreef in bericht
news:uxcWfIKaGHA.3992@TK2MSFTNGP05.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button