3

有谁知道如何使用 Microsoft Exchange Web 服务获取收件箱中标记的所有项目?

显然它们既不在 Tasks 文件夹中(即使它们出现在 Outlook 中),也没有IsReminderSet设置为true

以下尝试要么只返回约会,要么只返回真正的任务,但不返回标记的消息:

var msgsView = new ItemView(100);
var msgsFilter = new SearchFilter.IsEqualTo(ItemSchema.IsReminderSet, true);
var flagged = exSvc.FindItems(WellKnownFolderName.Inbox, msgsFilter, msgsView);

或者

var taskView = new ItemView(100);
var tasks = exSvc.FindItems(WellKnownFolderName.Tasks, taskView);

既不工作。

4

1 回答 1

0

我知道这个问题很老,但我刚刚发现列表示例代码看起来可以解决问题(我自己还没有测试过)来源:http: //independentsoft.de/exchangewebservices/tutorial/findmessageswithflag.html

    IsEqualTo restriction1 = new IsEqualTo(MessagePropertyPath.FlagStatus, "1"); //FlagStatus.Complete
    IsEqualTo restriction2 = new IsEqualTo(MessagePropertyPath.FlagStatus, "2"); //FlagStatus.Marked

    Or restriction3 = new Or(restriction1, restriction2);

    FindItemResponse response = service.FindItem(StandardFolder.Inbox
                 , MessagePropertyPath.AllPropertyPaths, restriction3);

for (int i = 0; i < response.Items.Count; i++)
{
    if (response.Items[i] is Message)
    {
         Message message = (Message)response.Items[i];

         Console.WriteLine("Subject = " + message.Subject);
         Console.WriteLine("FlagStatus = " + message.FlagStatus);
         Console.WriteLine("FlagIcon = " + message.FlagIcon);
         Console.WriteLine("FlagCompleteTime = " + message.FlagCompleteTime);
         Console.WriteLine("FlagRequest = " + message.FlagRequest);
         Console.WriteLine("-----------------------------------------------");
    }
}
于 2014-12-06T20:20:36.000 回答