1

I would like to open a .doc file search for some text and replace it with other text.

I know of the RANGE.replaceText(placeholder, newString) method but it is unreliable when you have mergfields, or other special formatting in the document and can mess the entire document up.

I am wondering if there is an alternative method, to manually search through the document paragraphs and grab the string and use the replaceText method of each string?

user2020457
  • 165
  • 1
  • 1
  • 13

1 Answers1

-1

This presents the alternatives. It is in the context of docx4j, but the options also apply in principle to POI.

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84