none
Outlook 2013 Reading EmailAddress for LinkedIn contacts RRS feed

  • Question

  • Hoping someone can point me in the right direction to achieve this or let me know what is in the realm of possibilities.

    In Outlook 2013, I have configured LinkedIn Social Network Accounts under Account Settings.

    This gives me access to LinkedIn Contacts.  I am trying to enumerate the contacts in LinkedIn which all works fine.  However, the Email1Address is blank, Email1AddressType is set to SMTP and the Email1EntryID has a wierd string in it

    "\0\0⮁ꐟꎾᤐ溝��༁ɔ\0老name@hotmail.com\0SMTP\name@hotmail.com\0". 

     I have copied and pasted from my debugger what I see when enumerating contactitems.  contactFolder is got through OutlookApplication.GetNamespace("MAPI").PickFolder() and selecting LinkedIn as the folder.

               IEnumerable<ContactItem> contacts = contactFolder.Items.OfType<ContactItem>();
                foreach (ContactItem contact in contacts)
                {

    Can someone let me know how I can get the email address properly for LinkedIn contacts?

    Thanks


    Tuesday, March 12, 2013 12:25 PM

All replies

  • I have never seen Email1Address  being empty while Email1EntryID is not...

    Can you try to use Email1EntryID  to call Application.Session.GetAddressEntryFromID, then use AddressEntry.Address property?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, March 12, 2013 2:41 PM
  • I havent seen this either so I am stumped.  The only thing I can think of is because it is a LinkedIn contact folder and contact properties are not accessible because it is a social connector?
    Anyway, thanks for our response.  I tried what you suggested and receive a generic COMException - "Sorry, something went wrong. You may want to try again.", -2147352567.
    Here is my code.  contactFolder is set to the LinkedIn folder through outlook.
                Microsoft.Office.Interop.Outlook.Application outlook;
                outlook = new Microsoft.Office.Interop.Outlook.Application();
                contactFolder = outlook.GetNamespace("MAPI").PickFolder();
                
                IEnumerable<ContactItem> contacts = contactFolder.Items.OfType<ContactItem>();
                foreach (ContactItem contact in contacts)
                {
                    AddressEntry entry = outlook.Session.GetAddressEntryFromID(contact.Email1EntryID); // exception is thrown here.

    I do not have this problem if I use a regular outlook contact default folder.

    Thanks for all your help.
    Tuesday, March 12, 2013 8:09 PM
  • Do you see the email addresses if you look at the contact with OutlookSpy (click the IMessage button and select the Email1Address property)?

    If you select the Email1OriginalEntryId, does OutlookSpy parse it and show the value in the "Symbol" edit box?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Monday, March 18, 2013 7:04 AM