0
votes

I am trying to get the address associated with a user from Outlook using this following code and it seems to consistently fail on some machines:-

  var application = CurrentAppointmentItem.Application;
            var session = application.Session;
            var organizer = CurrentAppointmentItem.GetOrganizer();
            var recipient = session.CreateRecipient(organizer.Name);
            var addressEntry = recipient.AddressEntry;
            var propertyAccessor = addressEntry.PropertyAccessor;
            var addressProperty = propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x800F101E");

The error is:-

System.Runtime.InteropServices.COMException (0x80004005): The operation failed.
   at Microsoft.Office.Interop.Outlook.PropertyAccessorClass.GetProperty(String SchemaName)

To be specific I am trying to get the SIP address (not the SMTP address) of the current user, does anyone have any ideas?

Extra info: despite the error message being on propertAccessor.GetProperty() it turns out that recipient.Resolve() fails for the recipient in the coded example.

1

1 Answers

0
votes

PR_EMS_AB_PROXY_ADDRESSES is only available on the GAL address entries. It will not be present for one the one-off SMTP address entries.

What exactly and why are you truing to do?