I am trying to read an address formatted on the Internet from a connected Outlook Exchange. I read all contacts from Outlook contacts, i.e. Not from the global address book (GAB), and the problem is that for all users who are stored in Contacts from Exchange GAB Ive, only the formatted X.500 address was read, which in this case is not useful. For all manually added contacts that are not in the Exchange server domain, the Internet address is exported as expected.
Ive basically used the following code snippet to list contacts:
static void Main(string[] args) { var outlookApplication = new Application(); NameSpace mapiNamespace = outlookApplication.GetNamespace("MAPI"); MAPIFolder contacts = mapiNamespace.GetDefaultFolder(OlDefaultFolders.olFolderContacts); for (int i = 1; i < contacts.Items.Count + 1; i++) { try { ContactItem contact = (ContactItem)contacts.Items[i]; Console.WriteLine(contact.FullName); Console.WriteLine(contact.Email1Address); Console.WriteLine(contact.Email2Address); Console.WriteLine(contact.Email3Address); Console.WriteLine(); } catch (System.Exception e) { } } Console.Read(); }
Is there a way to extract the Internet address instead of X.500?
source share