0

你有使用 EWS 的 SearchFilter 的经验吗?我正在尝试使用last modified time比 variable 的值更新的任务date。它确实以奇怪的方式与此代码一起使用,我还尝试将日期更改为 UTC 时间格式。任何建议我做错了什么?

        //Create the extended property definition.
        ExtendedPropertyDefinition taskLastUpdate = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Task, 0x3008, MapiPropertyType.SystemTime);

        //Create the search filter.
        SearchFilter.IsGreaterThanOrEqualTo filter = new SearchFilter.IsGreaterThanOrEqualTo(taskLastUpdate, date.ToString("s") + "Z");
        //Get the tasks.
        FindItemsResults<Item> tasks = _service.FindItems(WellKnownFolderName.Tasks, filter, new ItemView(100));
4

1 回答 1

2

我不确定为什么它不能与ExtendedPropertyDefinition.

解决方案:

SearchFilter greaterthanfilter = new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.LastModifiedTime, date );
SearchFilter filter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, greaterthanfilter);
Folder folder = Folder.Bind(_service, WellKnownFolderName.Tasks); //Or the folder you want to search in
FindItemsResults<Item> results = folder.FindItems(filter, new ItemView(1000));
于 2013-10-16T10:00:47.680 回答