我知道 Web Add in 项目尚不支持动态功能区按钮或菜单,想知道是否对此进行了任何改进。事实上,我的主要问题是:我正在尝试在对话框中运行我的网络插件,而不是在任务窗格中,但是当我尝试获取 Office Word 文档的自定义属性时,我可以从任务中执行此操作窗格,但不能在对话框上执行相同操作。当我尝试下面的代码时,我得到了 RichApi.Error:AccessDenied。我检查了域,但找不到任何问题。有什么建议吗?
async function readCustomDocumentProperties5() {
await Word.run(async (context) => {
let properties = context.document.properties.customProperties;
properties.load("key,type,value");
await context.sync();
for (var i = 0; i < properties.items.length; i++)
console.log(
"Property Name:" +
properties.items[i].key +
"; Type=" +
properties.items[i].type +
"; Property Value=" +
properties.items[i].value
);
});
}
错误:
Uncaught (in promise) RichApi.Error: AccessDenied
at new n (word-win32-16.01.js:26)
at n.i.processRequestExecutorResponseMessage (word-win32-16.01.js:26)
at word-win32-16.01.js:26
at async Dialog.html?_host_Info=Word$Win32$16.01$tr-TR$telemetry$isDialog$$0:47
at async readCustomDocumentProperties5 (Dialog.html?_host_Info=Word$Win32$16.01$tr-TR$telemetry$isDialog$$0:42)