Nick, Thank you for confirming the functionality. Basically, I'll have to assemble the Paragraph lines from all the Runs and then inspect the assembled Paragraph full text for my translation/substitution routine.
In essence, I think I will have to remove all the Runs after assembling them at runtime, translate/make substitutions, and then add a single Run back to the Paragraph with the whole text that was assembled. Is there a limit to the size of a given Run? Thanks, Keith On Fri, Sep 5, 2014 at 6:14 AM, Nick Burch <[email protected]> wrote: > On Thu, 4 Sep 2014, Keith Denny wrote: > >> *Results:* >> One call to r.getText(0) returns only '<<CLIENT_' ;therefore, there's no >> match with the comparison check of the entity tag of <<CLIENT_NAME>>. The >> following call to r.getText(0) returns only 'NAME>>'. Again, obviously, >> no >> match. >> > > This is normal. That's just how the word file format works. A given run > contains text that is all styled the same. A paragraph is made up of > possibly multiple runs, each run having text of the same style, each > subsequent run may or may not have a different style > > All depends on the history of the file, and what mood Word was in when > creating it > > 2. How do I ensure that I get the actual line, as it exists in the MS >> Word >> document, in POI so I can inspect and replace key text? >> > > Fetch the text at the paragraph level, then work out which run(s) to > change within that taking account that a given bit of text could well be > across multiple runs > > Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
