I want to be able to access the auto-complete address list that appears when typing into either the TO,CC or BCC lines within an email. I wish to be able to extract this data similarly to how I access other address lists within Outlook.
Would anyone be able to confirm if this is possible and if so how I could go about doing it.
This is currently how I'm extracting email addresses various other address lists.
foreach (Outlook.AddressEntry item in addressList.AddressEntries)
{
using (item.ComDisposable())
{
switch (item.AddressEntryUserType)
{
case Outlook.OlAddressEntryUserType.olExchangeUserAddressEntry:
case Outlook.OlAddressEntryUserType.olExchangeRemoteUserAddressEntry:
var exUser = item.GetExchangeUser();
Debug.WriteLine(exUser.PrimarySmtpAddress, "_GetOutlookContacts");
yield return new EGContact(exUser.Name, exUser.PrimarySmtpAddress, item.ID);
break;
case Outlook.OlAddressEntryUserType.olOutlookContactAddressEntry:
var contact = item.GetContact();
yield return new EGContact(contact.FullName, contact.Email1Address, item.ID);
break;
case Outlook.OlAddressEntryUserType.olExchangeDistributionListAddressEntry:
break;
default:
break;
}
}
}