0
我正在尝试使用javascript api为word 2016编写插件。该加载项应该有一个插入表的按钮,但我无法完成它的工作。Word插件插入表(Javascript)
Word.run(function (context) {
// Create a proxy object for the document body.
var body = context.document.body;
body.insertTable(2, 2, Word.InsertLocation.end, [["a", "b"], ["c", "d"]]);
// Synchronize the document state by executing the queued commands, and return a promise to indicate task completion.
return context.sync();
}).catch(function (e) {
console.log(e.message);
})
这是我必须测试它的方法。每当我激活它,它会导致单词挂起一会儿,然后什么也不做。我也已经确定问题与运行该方法的按钮无关。如果有人知道为什么或如何修复它,我会非常感谢。先谢谢你。