none
Import Outlook contacts RRS feed

  • General discussion

  • I have imported Outlook Contacts but i have two issues in that,

    a) I have imported outlook contacts by using GetDefaultFolder() using AddressList.So, i can import all the contacts email id in the AddressBook(ShowNames from the) but iam not able to load FirstName and LastName of the Contact.

    b) I have imported outlook contacts by using GetDefaultFolder() using ContactItems.So,i can import contacts(emailid,firstname & lastname) only in few folders.Not able to access contacts from all folders.

    Can anyone guide me how to access all contacts from all folders with their FirstName and LastName?
    • Changed type Bessie Zhao Tuesday, November 10, 2009 8:48 AM
    Monday, November 2, 2009 12:44 PM

All replies

  • Hello Aki,

    For issue a, it seems that you are creating a contact item for a address entry object. You could use the GetContact method [See: AddressEntry.GetContact Method]. I have made a test in my side, and I can see the first name and last name. For test, I set the index to 1. Code like this,
                Outlook.AddressList addlist = this.Application.Session.AddressLists[1];
                Outlook.AddressEntry addentry = addlist.AddressEntries[1];
                Outlook.ContactItem ci1 = addentry.GetContact();
                ci1.Display(missing);


     <<I have imported outlook contacts by using GetDefaultFolder() using ContactItems.So,i can import contacts(emailid,firstname & lastname) only in few folders.Not able to access contacts from all folders.>>
    For issue b, I am little confused about . Could you please explain more about this? Are you looking for this code?
                Outlook.Folder folder= this.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts) as Outlook.Folder;
                Outlook.ContactItem ci = folder.Items.Add(Outlook.OlItemType.olContactItem) as Outlook.ContactItem;
                ci.FirstName = "...";
                ...
                ci.LastName = "...";
                ci.Save();


    Best regards,
    Bessie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, November 4, 2009 8:22 AM
  • We are changing the issue type to "General Discussion" because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to "Question" by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, November 10, 2009 8:47 AM
  • ok thankyou for the help Bessie Zhao

    do you know how i get the php script and the values like client id, and secret .... do they work on localhost or they should be on test on server only ??

    Tuesday, April 23, 2013 7:40 AM