Java(ApachePOI):如何从MicrosoftWord检索注释/注释和相关的突出显示文本?
我有一个Microsoft word(.docx)文件,正在尝试检索注释及其关联的突出显示文本。你能帮忙吗 附加示例word文档的图片和用于提取注释的java代码。[文件中有一行“我的名字是约翰”。单词“约翰”用注释“名词”突出显示] 我能够提取注释(名词、形容词)。我想提取与注释“Noun”(Noun=John,形容词=great)相关的文本Java(ApachePOI):如何从MicrosoftWord检索注释/注释和相关的突出显示文本?,java,annotations,apache-poi,comments,Java,Annotations,Apache Poi,Comments,我有一个Microsoft word(.docx)文件,正在尝试检索注释及其关联的突出显示文本。你能帮忙吗 附加示例word文档的图片和用于提取注释的java代码。[文件中有一行“我的名字是约翰”。单词“约翰”用注释“名词”突出显示] 我能够提取注释(名词、形容词)。我想提取与注释“Noun”(Noun=John,形容词=great)相关的文本 FileInputStream fis=newfileinputstream(新文件(msWordFilePath)); XWPFDocument ad
FileInputStream fis=newfileinputstream(新文件(msWordFilePath));
XWPFDocument adoc=新XWPFDocument(fis);
XWPFWordExtractor xwe=新的XWPFWordExtractor(adoc);
XWPFComment[]comments=adoc.getComments();
for(int-idx=0;idx
FileInputStream fis = new FileInputStream(new File(msWordFilePath));
XWPFDocument adoc = new XWPFDocument(fis);
XWPFWordExtractor xwe = new XWPFWordExtractor(adoc);
XWPFComment[] comments = adoc.getComments();
for(int idx=0; idx < comments.length; idx++)
{
MSWordAnnotation annot = new MSWordAnnotation();
annot.setAnnotationName(comments[idx].getId());
annot.setAnnotationValue(comments[idx].getText());
aList.add(annot);
}[enter image description here][1]