EWS - 我怎么找到所有未完成的任务? [英] EWS - how do I find all incomplete tasks?

查看:179
本文介绍了EWS - 我怎么找到所有未完成的任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Exchange Web服务,试图得到的这是不完整的所有Outlook任务的列表。

I am using Exchange Web Services to try to get a list of all Outlook tasks which are not complete.

我有ExchangeService的实例,并试图找到所有未完成的任务是这样的:

I have an instance of ExchangeService, and attempt to find all incomplete tasks like this:

SearchFilter searchFilter = new SearchFilter.IsNotEqualTo(TaskSchema.Status, TaskStatus.NotStarted);
FindItemsResults<Item> tasks = service.FindItems(WellKnownFolderName.Tasks, searchFilter, view);



不过,在最后一行,我得到一个ServiceResponseException:指定的值是产权无效。 这似乎怪我,因为的 EWS文档明确规定该Task.Status应该是TaskStatus枚举值之一。创建其中比较对一个字符串值SearchFilter不会引起异常,但我还没有尝试过任何其他枚举选项,看看它们是否会相同的行为。

However, on the last line, I get a "ServiceResponseException: The specified value is invalid for property." This seems weird to me because the EWS documentation explicitly states that the Task.Status is supposed to be one of the TaskStatus enumeration values. Creating a SearchFilter which compares against a string value does not cause an exception, but I haven't tried any of the other enumeration options to see whether they give the same behavior.

推荐答案

我能够做到这一点使用ExtendedPropertyDefinition与Exchange 2007

I am able to do this using ExtendedPropertyDefinition with Exchange 2007.

我使用的 PidLidTaskComplete规范物业

可用命名属性的全部列表的这里

Full list of named properties available here.

//Create the extended property definition.
ExtendedPropertyDefinition taskCompleteProp = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Task, 0x0000811C, MapiPropertyType.Boolean);
//Create the search filter.
SearchFilter.IsEqualTo filter = new SearchFilter.IsEqualTo(taskCompleteProp, false);                    
//Get the tasks.
FindItemsResults<Item> tasks = service.FindItems(WellKnownFolderName.Tasks, filter, new ItemView(50));

这篇关于EWS - 我怎么找到所有未完成的任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆