views:

28

answers:

0

I am using the Microsoft.Exchange.WebServices assembly and am trying to retrieve Appointments which have a Reminder set to go off in a certain time period.

So basically I create a SearchFilter object using AppointmentSchema.ReminderDueBy:

SearchFilter.IsGreaterThanOrEqualTo startTime =
                new SearchFilter.IsGreaterThanOrEqualTo(
                AppointmentSchema.ReminderDueBy, DateTime.Now);

SearchFilter.IsLessThanOrEqualTo endTime =
                new SearchFilter.IsLessThanOrEqualTo(
                AppointmentSchema.ReminderDueBy, DateTime.Now.AddMinutes(2));

SearchFilter filter = new SearchFilter.SearchFilterCollection(
                LogicalOperator.And, new SearchFilter[] { startTime, endTime });

FindItemsResults<Item> results = service.FindItems(
                WellKnownFolderName.Calendar, filter, new ItemView(10));

This should find up to 10 appointments which have a reminder due in the next 2 minutes. When I call service.FindItems it fails with ServiceResponseException: "The property can not be used with this type of restriction."

MSDN documentation and community forums have proven fruitless.