首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Word插件插入表(Javascript)

Word插件插入表(Javascript)
EN

Stack Overflow用户
提问于 2017-03-27 19:12:23
回答 1查看 109关注 0票数 0

我正在尝试使用javascript api为word2016编写一个插件。这个插件应该有一个插入表的按钮,但我不能让它工作。

代码语言: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);
    })

下面是我测试它的方法。每当我激活它时,它会导致word挂起片刻,然后什么也不做。我也已经确保这个问题与运行方法.If的按钮无关。任何人知道为什么或如何修复它,我都会非常感激。提前谢谢你。

EN

回答 1

Stack Overflow用户

发布于 2017-03-29 17:08:16

我发现这个问题是因为我使用的word的构建版本不支持inserttable方法,所以更新word就是解决这个问题的方法

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43044817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档