On Sat, 10 Jul 2010, Mathias Dahl wrote:
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?
Each run has the same character properties. So, if you have something like
normal normal BOLD BOLD normal normal
You will have 3 runs in your paragraph. If you want to change the text in
the first bit, get the first XWPFRun and call setText("new text") on it
If you want to zap all the formatting and put in new text, delete all the
runs on the paragraph [p.removeRun(int)], create a new run, and set the
text on that
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]