Hi together,
I'm using the Outlook-Interop to read some Events from different calendars and show them on a big screen. On my machine everything works fine (Outlook 2010, Win7 x64), but on the client's pc (Outlook2003, Win XP) the program doesn't find all appointments. If I add some checkboxes for debugging the tool finds between 8 and 12 Appointments (12 it should find) and without always 6. I have no idea what's going wrong, so please help me out.
Here's the code:
this.Appointments = new List<AppointmentItem>();
foreach (MAPIFolder folder in this.SelectedCalendars)
{
foreach (object app in folder.Items)
{
if (app is AppointmentItem && ((AppointmentItem)app).Start.Date == DateTime.Now.Date)
{
this.Appointments.Add(((AppointmentItem)app));
}
}
}
this.Appointments.Sort(
delegate(AppointmentItem App1, AppointmentItem App2)
{
return App1.Start.CompareTo(App2.Start);
});