我正在尝试使用XWPFDocument.InsertNewParagraph(XmlDocument cursor),但该方法要求使用XmlDocument cursor,我不知道在哪里可以找到它,也不知道该使用什么。
我在网上找到的所有文档都是关于这个库的Java版本的,并且说要使用XWPFParagraph.getCTP().newCursor(),但在getCTP()返回的对象中没有名为newCursor的方法。
发布于 2021-06-01 18:03:02
查看NPOI的源代码,我发现这个包没有实现XWPFTableCell的InsertNewParagraph / InsertNewTbl / IsCursorInTableCell方法,它接收参数类型XmlDocument,但名称是XmlDocument(这也很奇怪)。以下是我的建议:
调用AddParagraph,在其中创建run(s) (IRun),最后调用SetParagraph而不是InsertNewParagraph。
https://stackoverflow.com/questions/63177287
复制相似问题