选择所有ooxml办公室插件js词2013年 [英] Selection of all ooxml office addin js word 2013
本文介绍了选择所有ooxml办公室插件js词2013年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何阅读办公室js addin for word 2013
解决方案
你可以试试使用'getOoxml'方法。
示例:
//对Word对象模型运行批处理操作。
Word.run(函数(上下文){
//为文档正文创建一个代理对象。
var body = context.document.body;
//对一个命令进行排队以获取正文的OOXML内容。
var bodyOOXML = body.getOoxml();
//通过执行排队命令同步文档状态,
//并返回一个表示任务完成的承诺。
返回context.sync()。然后(function(){
console.log(" Body OOXML contents:" + bodyOOXML .value);
});
})
.catch(函数(错误){
console.log("错误:" + JSON.stringify(error) );
if(错误实例OfficeExtension.Error){
console.log(" Debug info:" + JSON.stringify(error.debugInfo));
}
});参考:
问候
How can I read the entire ooxml of a document from office js addin for word 2013
解决方案
Hi gc70,
You can try to use 'getOoxml' method.
Example:
// Run a batch operation against the Word object model. 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)); } });Reference:
Regards
这篇关于选择所有ooxml办公室插件js词2013年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文