我正在开发一个需要创建Outlook Notes (StickyNote)的Outlook外接程序。由于Outlook REST API和Graph API不支持此功能,因此我使用Exchange Web服务(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 on web将所有笔记显示为灰色。我假设它使用另一个自定义属性来设置颜色。有人知道如何在Outlook网页版中设置便笺颜色吗?
发布于 2021-06-14 12:44:16
我建议您获得一个像MFCMapi的OutlookSpy这样的MAPI编辑器,并查看以下属性

如果我在JSON _Note属性中设置颜色,它是一个JSON字符串,如下所示
{"schemaVersion":"beta","documentModifiedAt":"2021-01-13T02:18:33.411Z","document":{"type":"document","blocks":[{"type":"paragraph","id":"ej73vbcb-c65a-4a4e-944a-243f540eaa16","content":[{"text":"test1","styles":null}],"blockStyles":[{"textDirection":"ltr"}]},{"type":"paragraph","id":"55pcod81-f62a-4cc8-be0b-ea28404bd60b","content":null}]},"createdWithLocalId":"1f202a39-cc90-4812-b7ff-9beef48af549","createdWithLocalId@Is.Queryable":"True","createdByApp":"OWA","createdByApp@Is.Queryable":"True","color":4,"color@Is.Queryable":"True","documentModifiedAt@Is.Queryable":"True","#type.documentModifiedAt":"DateTime","#type.createdWithLocalId":"String","#type.createdByApp":"String","#type.color":"Int32"}
然后刷新OWA,这将更改OWA中便笺的颜色。更改#color属性似乎没有任何作用。一些问题,虽然这将是不受支持的,颜色之间的Outlook桌面和OWA之间不同步的时刻,整数值没有事件对齐,例如3是黄色的Outlook桌面和粉红色的OWA。也许有必要在Q&A https://docs.microsoft.com/en-us/answers/topics/office-outlook-itpro.html上问另一个问题(不要提到任何关于尝试使用代码的内容),只需要问一下为什么当你使用客户端时桌面和OWA之间的颜色不同步。
https://stackoverflow.com/questions/67943130
复制相似问题