问题
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