473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Outlook COM object in C#

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.
Apr 25 '06 #1
5 2034
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.

Apr 25 '06 #2
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
-------------------------------------------------------

"Andy" <aj*****@alum.rit.edu> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
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.

Apr 25 '06 #3
I am using the Office PIA's

"Andy" <aj*****@alum.rit.edu> schreef in bericht
news:11**********************@u72g2000cwu.googlegr oups.com...
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.

Apr 25 '06 #4
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:ux**************@TK2MSFTNGP05.phx.gbl...
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
-------------------------------------------------------

"Andy" <aj*****@alum.rit.edu> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
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.


Apr 25 '06 #5
Isn't there an inner exception?

Apr 26 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John | last post by:
Hi When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am...
2
by: John | last post by:
Hi I am trying to find the way to create an email in outlook. I am using the code given at the end. It works fine the first time but calling the code second time gives the following error; ...
9
by: Srinivas | last post by:
hi all how to access the outlook user profiles through VB.net any help.... thanks in advanc Srinivas
8
by: Li Pang | last post by:
Hi, I used following codes to pass a message item from CDO to Outlook. They worked fine when I used outlook 2000, but get an error of "Specified cast is not valid." when I used Outlook 2003....
3
by: wizzbangca | last post by:
Hi everyone. Having problems with a utility I am writing for work. The previous IT Director thoughtfully allowed 3 (2000, xp, 2003) versions of outlook to be installed rather than 1. Now I need...
4
by: Pieter | last post by:
Hi, On the pc of one of my clients (W2000, Office 2003) I'm getting sometimes an exception when moving (Move) a MailItem to an Outlook-Folder: The RPC server is not available. (Exception from...
2
by: Pieter | last post by:
Hi, I'm using a thight integration with Outlook 2003 (with an Exchange server) in my VB.NET (2005) application. Until now I'm using the Outlook Object Model, but it appears to be very slow, and...
7
by: Dean Spencer | last post by:
Can anyone help? I am importing Emails from Outlook using the following code: Public Function ScanInbox(SubjectLine As String) Dim TempRst As Recordset Dim OlApp As Outlook.Application Dim...
5
by: fniles | last post by:
I am using VB.NET 2005. I created a project using the Microsoft Outlook 8.0 Object Library (Object Model) in my previous machine. Now that I have a new machine, when I try to compile that program...
1
by: Sylfelin | last post by:
Hello, If I use Microsoft Outlook 12.0 Object Library (Outlook 2007) COM Object in my application, the custommer must have the outlook 2007 on his computer ? But if i use Microsoft Outlook...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.