Obtaining the contact link for the AppointmentItem.Organizer

J

Jayme.Pechan

I'm trying to obtain the contact for the AppointmentItem.Organizer that pops
up if you double click the organizer in an appointment item.
Programmatically, if I use mi.Organizer, it is a string and its always a
name rather than an email address or something I can reliably use to search
for the contact. Any ideas how I could make this link? Thanks.
 
J

Jayme.Pechan

I managed to figure out an answer to my own question so I'll go ahead and
post it.

Outlook.AppointmentItem mi = ciItem as
Outlook.AppointmentItem;
Outlook.PropertyAccessor pa =
mi.PropertyAccessor;
if (pa != null)
{
string SenderID =
pa.BinaryToString(pa.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0C190102"));
Outlook.AddressEntry oSender =
Application.Session.GetAddressEntryFromID(SenderID);
if (oSender != null &&
oSender.AddressEntryUserType ==
Microsoft.Office.Interop.Outlook.OlAddressEntryUserType.olSmtpAddressEntry)
{
string senderEmail = oSender.Address;
...

I then use the email address to lookup the contact and then I can display
the contact if I like or do whatever.

Jayme Pechan
Whitefeld
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top