// TODO Auto-generated method stub
org.apache.poi.hwpf.extractor.WordExtractor doc = null;
try {
doc = new WordExtractor(new FileInputStream("D:\\del\\test.doc"));
String[] comments = doc. getCommentsText();
System.out.println(comments[0]);
int pages = doc.getSummaryInformation().getPageCount();//总页数
int wordCount = doc.getSummaryInformation().getWordCount();//总字符数
System.out.println(pages);
System.out.println(wordCount);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//提取.doc正文文本
String text = doc.getText();
System.out.println(text);