I have to insert a field around a selected range to implement a functionality. As fileds are not supported in office-js I am using office open xml . I have implemented the code to insert a field before and after a selected text in a word document. OOXML corresponding to the field inserted looks like.
<w:r>
<w:fldChar w:fldCharType='begin' />
</w:r>
<w:r>
<w:instrText xml:space='preserve'>confidential</w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType='end' />
</w:r>
After inserting is there anyway I can select the range where the fields are inserted.
For example in Word.ContentControl class we have select() method which will scroll to the selection, Also it has getRange() method.
Is there any way the same functionalities ( select() and getRange() ) can be done for a field inserted in a document
office-js word web-addin