0
我正在使用Office.context.mailbox.makeEwsRequestAsync方法向EWS發送以下XML查詢。帶有「AND」和「OR」子句的EWS搜索查詢
查詢字符串值需要匹配主題或來自字段;並且電子郵件必須屬於「MY_CATEGORY」類別。我無法執行最後一項要求。我究竟做錯了什麼?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beginning" />
<m:Restriction>
<t:Or>
<t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Subject" />
<t:Constant Value="query string" />
</t:Contains>
<t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="message:From" />
<t:Constant Value="query string" />
</t:Contains>
</t:Or>
<t:And>
<t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Categories" />
<t:Constant Value="MY_CATEGORY" />
</t:Contains>
</t:And>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="inbox" />
<t:DistinguishedFolderId Id="sentitems" />
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>
但會與多個文件夾這項工作?請注意,原始查詢正在搜索收件箱和發送的文件夾。 –
是否可以使用javascript調用創建EWS「搜索文件夾」? –
它應該適用於多個文件夾,但您應該自己嘗試,您可以使用EWS創建搜索文件夾,例如https://msdn.microsoft.com/zh-cn/library/office/dd633687(v=exchg.80)。 aspx –