I am developing a small Outlook add-in which will fetch all information about selected meeting and push this information to our in-house portal. Implementation is complete except RequiredAttendees part. Not sure why, but Interop.Outlook.AppointmentItem object is only returning full names (as string) of the attendees. I am more interested in their email address of attendees. Here is my code snippet to replicate the issue:
try
{
AppointmentItem appointment = null;
for (int i = 1; i < Globals.ThisAddIn.Application.ActiveExplorer().Selection.Count + 1; i++)
{
Object currentSelected = Globals.ThisAddIn.Application.ActiveExplorer().Selection[i];
if (currentSelected is AppointmentItem)
{
appointment = currentSelected as AppointmentItem;
}
}
// I am only getting attendees full name here
string requiredAttendees = appointment.RequiredAttendees;
}
catch (System.Exception ex)
{
LogException(ex);
}
I can see RequiredAttendees property is defined as string in Microsoft.Office.Interop.Outlook._AppointmentItem interface.
//
// Summary:
// Returns a semicolon-delimited String (string in C#) of required attendee
// names for the meeting appointment. Read/write.
[DispId(3588)]
string RequiredAttendees { get; set; }
I will greatly appreciate if someone can help me to resolve this issue or provide some around to get attendees email addresses.
Thanks.
Something like this (not tested):