tags:

views:

7

answers:

0

I have been able to loop through all paragraphs in a document and get at the text and everything and I have read and understood how you can create a document from scratch. But how can I update and replace the text in a paragraph? I can do createRun in a paragraph but that will just create a new piece of text in it.

 ...
 FileInputStream fis = new FileInputStream("Muu.docx");
 XWPFDocument myDoc = new XWPFDocument(fis);
 XWPFParagraph[] myParas = myDoc.getParagraphs();
 ...

My theory is that I need to get at the existing "run" in the paragraph I want to change, or delete the paragraph and add it again) but I cannot find methods to do that.

Thanks!