我有一个基于Office JS的Outlook Addin,我在OWA中成功使用了,以及Mac上的Outlook厚客户端(以及Windows,当我有机会启动我的Windows VM)。
我的编写时,我的addin在消息项上设置了一些 CustomProperties
,然后保存这些属性以供以后使用。
该代码看起来很像Office-JS文档中的样本,但这是一个删节版本以供参考:
Office.context.mailbox.item.loadCustomPropertiesAsync((result: AsyncResult): void => {
let customProperties = result.value;
let oldValue = customProperties.get("foo);
let newValue = Date.now();
console.log("Old value = ", oldValue, ", setting to: ", newValue);
customProperties.set("foo", newValue.toString());
customProperties.saveAsync(() => {});
});
但是,看来CustomProperties
的状态在OWA中运行的addin和在Outlook中运行的同一addin之间没有共享。
示例:
在OWA中编辑消息,将" Foo" CustomProperty
设置为当前时间戳(我们将其称为" TS1")。如果我关闭OWA会话,请再次打开项目,我会看到CustomProperty
设置为预期值。
现在,如果我在Outlook中打开相同的消息,则" foo" CustomProperty
是空的。
然后,如果我从Overook设置了" Foo" CustomProperty
(我们调用新值" TS2"),然后在OWA中重新启动我的addin,我仍然看到具有初始值i的" foo" CustomProperty
设置在OWA,即" TS1"。
CustomProperties
的文档中没有任何内容意味着除了添加特定于辅助外,值除了每个客户之外。这只是一个错误,还是属性是私人的意图?
谢谢!
这是一个已知的错误,我们正在努力修复它。