I have place items on the calender (in the past), however the FindItems()
call is coming back with 0 results.
Screenshot to show there are meetings scheduled for this Room Mailbox for the desired date
Code for the search
SearchFilter greaterthanfilter = new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeReceived, start);
SearchFilter lessthanfilter = new
SearchFilter.IsLessThan(ItemSchema.DateTimeReceived, end);
SearchFilter filter = new
SearchFilter.SearchFilterCollection(LogicalOperator.And, greaterthanfilter, lessthanfilter);
ItemView view = new ItemView(100); //TODO: This value needs to be set based on the date range criteria
ExtendedPropertyDefinition prop = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8238, MapiPropertyType.String);
PropertySet psPropset = new PropertySet(BasePropertySet.FirstClassProperties) { AppointmentSchema.Subject, AppointmentSchema.Organizer, prop };
view.PropertySet = psPropset;
view.OrderBy.Add(ItemSchema.DateTimeReceived, Microsoft.Exchange.WebServices.Data.SortDirection.Descending);
view.Traversal = ItemTraversal.Shallow;
findResults = this.exchangeService.FindItems(new FolderId(WellKnownFolderName.Calendar, new Mailbox(address.Address)), filter, view);
The start and ends dates are fed in via the parameters of the method. I have breakpointed there and ensured the dates are
Start - 1/6/2014 12 am
End - 1/8/2014 12 am
However the findResults
are always empty (count is 0).