Replace form field and content control tags with a plain text

In my document, I have added some Form Field tags and some Content Control tags (Structured Document tag). I want to replace these Form Field tags and Content Control tags with a plain text using java code.

  1. < Form Field tags> replaced with “text”.
  2. replaced with “text”.

My input file is input.PNG and the output file is output.PNG
input.PNG (95.1 KB)
output.PNG (87.9 KB)

@rabin.samanta

In your case, we suggest you following solution.

  1. Get the form fields using Document.Range.FormFields property. For content control, please use Document.GetChildNodes.
  2. Iterate over form fields or content controls.
  3. Move the cursor to the node (form field or content control).
  4. Insert the desired content.
  5. Remove the node.

Hope this helps you.

@tahir.manzoor
thanks…