how to remove a XWPFHyperlinkRun by poi

匿名 (未验证) 提交于 2019-12-03 10:10:24

问题:

i'm using poi to export a word file. it's my source. the question is that if the run is a textRun,i can remove it by this method(para.removeRun) but if the run is a XWPFHyperlinkRun it doesn't work .. so...how can i remove a XWPFHyperlinkRun?

InputStream fs = new FileInputStream("MY_WORD_FILE_Path");      XWPFDocument doc=new XWPFDocument(fs);      List<XWPFParagraph> paras = doc.getParagraphs();      for (XWPFParagraph para : paras) {         para.removeRun(0);        }      FileOutputStream out = new FileOutputStream("D:\\testxx.docx");              doc.write(out);              out.close(); 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!