【发布时间】:2021-06-28 12:17:32
【问题描述】:
我正在开发一个需要创建 Outlook 便笺 (StickyNote) 的 Outlook 加载项。由于 Outlook REST API 和 Graph API 不支持这一点,我正在使用 Exchange Web Services (EWS)。我可以成功创建这样的笔记:
createNote(subject, body) {
var xml =
'<?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:xsd="https://www.w3.org/2001/XMLSchema"' +
' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">' +
' <soap:Body>' +
' <m:CreateItem MessageDisposition="SaveOnly">' +
' <m:SavedItemFolderId>' +
' <t:DistinguishedFolderId Id="notes" />' +
' </m:SavedItemFolderId>' +
' <m:Items>' +
' <t:Message>' +
' <t:ItemClass>IPM.StickyNote</t:ItemClass>' +
' <t:Subject>' + subject + '</t:Subject>' +
' <t:Body>' + body + '</t:Body> ' +
' <t:ExtendedProperty>' +
' <t:ExtendedFieldURI PropertySetId="0006200E-0000-0000-C000-000000000046" PropertyId="35584" PropertyType="Integer" />' +
' <t:Value>1</t:Value>' +
' </t:ExtendedProperty>' +
' </t:Message>' +
' </m:Items>' +
' </m:CreateItem>' +
' </soap:Body>' +
'</soap:Envelope>';
Office.context.mailbox.makeEwsRequestAsync(xml, function (result) {
if (result === Office.AsyncResultStatus.Succeeded)
console.log(result.value);
});
}
扩展属性是设置便笺的颜色(0 = 蓝色,1 = 绿色,2 = 粉红色,3 = 黄色,4 = 白色)。但是,这仅适用于 Outlook 桌面应用程序。 Outlook 网页版将所有笔记显示为灰色。我假设它使用另一个自定义属性来设置颜色。任何人都知道如何在 Outlook 网页版中设置笔记颜色?
【问题讨论】:
-
在不涉及 Office 插件的情况下使用纯 EWS 是否获得相同的结果?
标签: exchange-server exchangewebservices outlook-web-addins