I am trying to integrate my application with Outlook. I have referred to Integrating IM applications with Office.
I met an issue when an Outlook/Office account has two different email addresses, Outlook will call the IContactManager.GetContactByUri()
API twice with the two email addresses. Because I don't know the two email addresses belongs to one account, I will return different property values of the two emails to Outlook, which finally lead to Outlook showing an unexpected state on the contact page.
For example, one Outlook account Glider
has two email addresses glider123@xxx.com
and gliderABC@xxx.com
. In my application, account glider123@gmail.com
is in the presence state of busy, while gliderABC@xxx.com
is in the presence state of free.
Because I don't know glider123@xxx.com
and gliderABC@xxx.com
belong to one Outlook account Glider
, when Outlook calls the GetContactByUri()
API, I will create two IContact
instances on my local, and they will return different presence state values to Outlook. Finally, on the contact page of Glider
in Outlook, its presence state is free.
I know MAPI can solve this, but is there any other way?
For an Exchange account, multiple proxy addresses are stored in the PR_EMS_AB_PROXY_ADDRESSES
MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x800F101F
), which can be accessed in Outlook Object Model using AddressEntry.PropertyAccessor.GetProperty
.