Index: src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java (revision 787160) +++ src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java (working copy) @@ -345,6 +345,28 @@ } /** + * Returns the range which covers all the Endnotes. + */ + public Range getEndnoteRange() { + return new Range( + _cpSplit.getEndNoteStart(), + _cpSplit.getEndNoteEnd(), + this + ); + } + + /** + * Returns the range which covers all the Endnotes. + */ + public Range getCommentsRange() { + return new Range( + _cpSplit.getCommentsStart(), + _cpSplit.getCommentsEnd(), + this + ); + } + + /** * Returns the range which covers all "Header Stories". * A header story contains a header, footer, end note * separators and footnote separators. Index: src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java (revision 787160) +++ src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java (working copy) @@ -22,6 +22,7 @@ import java.io.FileInputStream; import java.io.UnsupportedEncodingException; import java.util.Iterator; +import java.util.Arrays; import org.apache.poi.POIOLE2TextExtractor; import org.apache.poi.hwpf.HWPFDocument; @@ -95,34 +96,58 @@ * Get the text from the word file, as an array with one String * per paragraph */ - public String[] getParagraphText() { - String[] ret; + public String[] getParagraphText() { + String[] ret; - // Extract using the model code - try { - Range r = doc.getRange(); + // Extract using the model code + try { + Range r = doc.getRange(); - ret = new String[r.numParagraphs()]; - for(int i=0; i -1 ); } + + public void testFootnote() throws Exception { + HWPFDocument doc = new HWPFDocument( + new FileInputStream(filename6) + ); + extractor = new WordExtractor(doc); + + String[] text = extractor.getFootnoteText(); + StringBuffer b = new StringBuffer(); + for (int i=0; i