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

不想你离开。 提交于 2020-06-28 05:07:10

问题


I'm pretty new to the Office.js/Word.js features.

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. 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.

Thanks, Alan


回答1:


there is no API to directly do this, however you can achieve it using OOXML insertion. Make sure to get the OOXML that has an XML mapping and the insert the OOXML using range.insertOOXML(ooxml, "replace") option. (contentcontrol.insertOoxml(ooxml, "replace") will also work.



来源:https://stackoverflow.com/questions/44121540/is-there-a-way-to-bind-word-content-controls-to-a-custom-xml-part-using-office-j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!