首页 > 解决方案 > Word 加载项:更改 Word 文档正文(如 html)或替换

问题描述

在为 Outlook 编写插件时,有两个 API 允许更改项目的 html: Office.context.mailbox.item.body.getAsync-> 获取邮箱项目的 html,另一个 API 设置 html:

Office.context.mailbox.item.body.setAsync

编写 Word 插件(或 Powerpoint 插件)时的等价物。我看到了一个 API 函数来获取文档的 html: Office.context.document.getSelectedDataAsync,或者 Word 特定的 API,它是body.getHtml()

但我只看到了一个设置选定区域的API:

Office.context.document.setSelectedDataAsync

我错过了什么?我只是希望能够获取文档(或演示文稿)的 html,能够根据需要进行更改,然后将其设置回来。

标签: office-jsoffice-addinsoffice-storeword-web-addins

解决方案


推荐阅读