Mridul Choudhary
Mridul Choudhary

Reputation: 15

How do I remove all comments from docx file using Apache POI or Docx4j?

I'm not able to remove all the comments present in docx file using Apache POI . Is there any other way of removing the comments using docx4j api ?

Upvotes: 1

Views: 611

Answers (1)

JasonPlutext
JasonPlutext

Reputation: 15878

Sure. Basically it is 2 steps.

Step 1: find the various comment tags in the main document part and delete them.

Step 2: delete the comments part.

https://github.com/plutext/docx4j/blob/master/docx4j-samples-docx4j/src/main/java/org/docx4j/samples/CommentsDeleter.java does step 1.

Upvotes: 2

Related Questions