tags:

views:

77

answers:

3

I am developing a desktop application using C#, and I do not know how to edit a contact info in outlook, I Google-d it but no use.

any suggestions?

Thanks in advance.

Ok, sorry maybe I was not clear enough, I know how to retrieve and add contacts to outlook, what I am asking about is updating contacts.

A: 

http://geekswithblogs.net/timh/archive/2006/05/26/79720.aspx

I might try to above. It looks like first you reference the Outlook COM object, and then create a Microsoft.Office.Interop.Outlook.Application from which you should be able to edit outlook objects.

MattUebel
+1  A: 

Download and install VSTO, then add a reference to Microsoft.Office.Interop.Outlook to your project. This will give you access to the Outlook object model.

Bradley Smith
ok, I can retrieve and add contacts from outlook, but I cannot update.
omar
+2  A: 

The solution is quite easy, though I did not find it using google.

  1. retrieve the outlook contact.

        Outlook.Items ctcItems = cf.Items;
        Outlook.Items items = ctcItems;
        Outlook.ContactItem ctc = (Outlook.ContactItem)items[index];
    

cf in the code above is the Outlook.MAPIFolder.

  1. update the Outlook.ContactItem .

    ctc.FullName = "Laurel";
    

    . . . . .

  2. save Outlook.ContactItem .

    ctc.Save();

Thanks for any replies.

omar