This project is read-only.

How do I accept changes in a Word document?

Jul 21, 2011 at 12:52 PM

I'm extracting text from a DOC file. It works great, except when the document has tracked changes. If there are tracked changes, text that has actually been deleted ends up being extracted.  Here's my code:

POIFSFileSystem fs = new POIFSFileSystem(fileStream);
HWPFDocument document = new HWPFDocument(fs);
NPOI.HWPF.Extractor.WordExtractor extractor = new NPOI.HWPF.Extractor.WordExtractor(document);
output = extractor.Text;

Is there a way to use NPOI to accept all tracked changes/revisions in the document before extracting?  Alternatively, is there a way to set the extractor so that it only extracts text that would appear in the final document?

Thanks for any advice,



Sep 24, 2011 at 8:27 AM

HWPF is in the very early stage of development. The feature you wanted is not supported so far.