Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / April 2006

Tip: Looking for answers? Try searching our database.

Outlook COM object in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bruno Windels - 25 Apr 2006 18:04 GMT
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.
Andy - 25 Apr 2006 20:31 GMT
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 - 25 Apr 2006 20:54 GMT
can you extract an error code or further details, maybe a stack dump?

Signature

________________________
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
-------------------------------------------------------

> 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.
Bruno Windels - 25 Apr 2006 21:47 GMT
Can't check right now, but IIRC no. The COMException is thrown by
getItemFromID, that is all the stack trace says ... IIRC

> can you extract an error code or further details, maybe a stack dump?
>
[quoted text clipped - 3 lines]
>> You should be using the latter.  If you are using them... not sure what
>> the problem would be.
Andy - 26 Apr 2006 13:35 GMT
Isn't there an inner exception?
Bruno Windels - 25 Apr 2006 21:46 GMT
I am using the Office PIA's

> 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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.