OK, so just to be clear, if you create a document using LibreOffice, insert a bookmark and then try to insert some text at the bookmark's position, the code fails completely? Are you saying that it does not insert the text at all at the specified location? Or are you saying that because LibreOffice does not allow you to bookmark text - Hello world in your example - then the code will not replace the intended target? Sorry to be pedantic but the two things are VERY different, one is a problem with the code posted on this site - and something I could look at - the other a limitation of LibreOffice.
Remember that bookmarks work as a pair of tags. There is an opening and a closing bookmark tag and the replacement code works by matching them up and replacing anything it finds in-between. If LibreOffice does not allow you to bookmark text then the opening and closing tag pair will be - put simply - empty. There is nothing to replace as far as the code is concerned and so all it can do is insert some text into the document at the specified location. To be clear, using your test LibreOffice document, is it doing this? -- View this message in context: http://apache-poi.1045710.n5.nabble.com/How-to-read-the-value-of-bookmarks-docx-tp5710184p5711706.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
