exchange server - How to get occurence number of a recurrent meeting from the EWS using c#? -
below link modifying , deleting occurrence of recurrence meeting.
http://msdn.microsoft.com/en-us/library/exchange/dd633618(v=exchg.80).aspx
my question how can occurrence number ews or there way find it.
appointment occurrence = appointment.bindtooccurrence(service, new itemid(srecurringmasterid), 3);
in above code have hard coded occurrence number 3, how can info dynamically?
there no direct way , following:
- get appointment recurringmaster.
- define start , ending time recurrence, if there no end time , goes forever, define number of days search within
- find appontments based on previous timings
- filter results based on type appointmenttype.occurrence, , count got
the following code explains have written above.
var occurrencescounter = 0; if (appointment.appointmenttype == appointmenttype.recurringmaster) { appointments = ppointment.service.findappointments(wellknownfoldername.calendar, new calendarview(appointment.start, (appointment.recurrence.enddate == null ? datetime.today.adddays(7) : (datetime)appointment.recurrence.enddate))); foreach (var apt in appointments) { if (apt.appointmenttype == appointmenttype.occurrence) { occurrencescounter++; } } }
Comments
Post a Comment