当使用 JavaScript 通过以下代码获取 OOXML 正文 (bodyOOXML.value) 作为字符串时,不包括 word/numbering.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));
}
});
包括 word/styles.xml、word/fontTable.xml 等,但没有编号包,我们无法重新创建数字格式。任何帮助表示赞赏!