Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Recurring appointments aren't expanding recurrence using CalendarFolder.FindAppointments in the C# Exchange Web Service API

$
0
0

According to the docs, .FindAppointments() expands the recurrence of items:

Obtains a list of appointments by searching the contents of this  folder and performing recurrence expansion for recurring appointments

It's not working:

ExchangeService service =ExchangeServiceUtilities.CreateExchangeService(s,u);DateTime now =DateTime.Now;CalendarView cv =newCalendarView(now, now);CalendarFolder cal =CalendarFolder.Bind(service,WellKnownFolderName.Calendar);FindItemsResults<Appointment> apps = cal.FindAppointments(cv);Trace.WriteLine(apps.TotalCount);foreach(Appointment a in apps){
                a.Load();Trace.WriteLine(a.IsRecurring);Trace.WriteLine("Checking: "+ a.End.ToString()+" : "+ now);if(a.End> now){Trace.WriteLine("Setting Appointment for: "+ u.Id);ScheduleAppointment(a,u);}}

produces the following:

1TrueChecking:6/24/201310:00:00 PM :6/24/20139:41:12 PMSettingAppointmentfor:6dd36837d202bf28b0a8cfece47fb111cd0fec04

It's set to recur every half hour, so I should be seeing a lot more of them...


Viewing all articles
Browse latest Browse all 7132

Trending Articles