AppointmentItems list doens't contain any future appointments
I'm trying to iterate through all my _future_ appointments but all I
get are appointments from today and into the past. No future
appointments are returned.
This is what I'm doing:
NameSpace ns = theApp.GetNamespace("MAPI");
MAPIFolder cal =
ns.GetDefaultFolder(OlDefaultFolders.olFolderCalen dar);
cal.Items.Sort("[Start]",true);
cal.Items.IncludeRecurrences = true;
foreach (AppointmentItem item in cal.Items)
{
if (item == null)
continue;
if( item.Start = DateTime.Now )
// do something...
}
The only appts that show up in cal.Items are from 9/01/2006 to
02/21/2007. I have an appt on 3/1/2007 but it doesn't show up.
BTW, I tried:
AppointmentItem i = cal.Items.Find("[Start] = '03/01/2006 10:30AM'")
as AppointmentItem;
and it returned null.
Am I doing something wrong?
thanks for your time!
|