简体   繁体   English

有没有一种方法可以使用office-js将Word内容控件绑定到自定义XML部件?

[英]Is there a way to bind Word content controls to a custom XML Part using office-js?

I'm pretty new to the Office.js/Word.js features. 我对Office.js / Word.js功能还很陌生。

Trying to determine if there is there a way to bind Word content controls to a custom XML Part using the current feature sets for Office (JavaScript) Add-Ins. 尝试确定是否存在使用Office(JavaScript)加载项的当前功能集将Word内容控件绑定到自定义XML部件的方法。 If not, anyone know if this feature has been requested? 如果不是,那么有人知道是否已请求此功能吗? It can be done in the VBA and VSTO object models using by assigning an XML Mapping using XPATH. 通过使用XPATH分配XML映射,可以在VBA和VSTO对象模型中完成此操作。

Thanks, Alan 谢谢,艾伦

there is no API to directly do this, however you can achieve it using OOXML insertion. 没有API可以直接执行此操作,但是您可以使用OOXML插入来实现。 Make sure to get the OOXML that has an XML mapping and the insert the OOXML using range.insertOOXML(ooxml, "replace") option. 确保获取具有XML映射的OOXML,并使用range.insertOOXML(ooxml,“ replace”)选项插入OOXML。 (contentcontrol.insertOoxml(ooxml, "replace") will also work. (contentcontrol.insertOoxml(ooxml,“ replace”)也将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM