Reputation: 2314
I would like to get the meeting organizer mail address with the EWS API. Currently I'm just getting the a few properties of my appointment item. I heard that you can set which properties you want to get. My code looks like that:
CalendarView cview = new CalendarView(start, end);
cview.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
FindItemsResults<Appointment> appResults = calenFolder.FindAppointments(cview);
Upvotes: 6
Views: 5036
Reputation: 7427
I had the same issue and managed to populate the Organizer.Address property using this:
ExchangeService service = calenFolder.Service;
service.LoadPropertiesForItems(appResults, PropertySet.FirstClassProperties);
Upvotes: 2
Reputation: 20244
I know the question is old, but since I found it, others may find it as well. And then, the solution is five years older than this question.
The solution is in fact simple and will be found quickly when trying to post this problem at the microsoft forums:
Short summary:
The organizer field does not contain an SMTP Address when retrieved with ExchangeService.FindAppointments, but it does if retrieved with ExchangeService.BindToItems or Appointment.Bind.
Upvotes: 1
Reputation: 2617
there is a property in the appointment item for that , which is Organizer.Address
so if you have appointment variable called appointment the following code retrieves the organizer address
Var address = appointment.Organizer.Address;
Try to use this code
var appointments = _service.FindAppointments(WellKnownFolderName.Calendar, new CalendarView(start,end));
foreach (var appointment in appointments)
{System.Diagnose.Writeline(appointment.Organizer.Address)}
Upvotes: -1