【发布时间】:2021-11-10 12:16:01
【问题描述】:
我正在使用 office js。在单元格中添加了我的加载项评论与 mac office 和 office 365 一起正常工作,但我无法在 windows pc office 哪个版本的 office 2016 中插入 cmets。 我做错了什么?请指导我谢谢。这是我的代码 sn-p
await Excel.run(async (ctx) => {
let wb = ctx.workbook;
await ctx.sync().then(async () => {
try {
const address="sheet!A4"
var comment = wb.comments.getItemByCell(address);
comment.delete();
wb.comments.add(address, "This is simple test comment");
} catch (error) {
if (error.code == Excel.ErrorCodes.itemNotFound) {
wb.comments.add(address, "This is simple test comment");
console.log("Add comment successfully!");
}
}
});
await ctx.sync();
});
【问题讨论】:
-
这个
await ctx.sync().then(async () =>看起来很乱。您可以删除等待并检查吗? -
我已经删除然后我检查了它仍然无法正常工作。
标签: office365 ms-office office-addins