当使用以下代码使用 JavaScript 获取 OOXML 正文 (bodyOOXML.value) 作为字符串时,不包括单词/编号.xml包:
Word.run(function (context) {
// Create a proxy object for the document body.
var body = context.document.body;
// Queue a commmand to get the OOXML contents of the body.
var bodyOOXML = body.getOoxml();
// Synchronize the document state by executing the queued commands,
// and return a promise to indicate task completion.
return context.sync().then(function () {
console.log("Body OOXML contents: " + bodyOOXML.value);
});
})
.catch(function (error) {
console.log("Error: " + JSON.stringify(error));
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
包括单词/样式.xml,单词/字体表.xml等,但没有编号包,我们无法重新创建数字格式。任何帮助表示赞赏!
这是个问题,因为办公室是 2016 年升级到 2019 年时问题已解决