As far as I am aware, bookmarks must have unique names and, as you said, can
only appear once in the document.

The most obvious answer is to create your own version of a bookmark and to
use simple search and replace functionality to handle this requirement. As
an example, image that you write something like this;

[Replace_Me]

at several places within the document, then you could write code to search
for each instance of [Replace_Me] and substitute another string of text.
Quite how you format 'your' bookmarks would depend upon the contents of the
document but it should be possible to create some standard format. Of
course, it does go without saying that you would lose the bookmark
functionality that Word offers when the user has the document open in front
of them; it is possible, as I am sure you know, to go straight to a bookmark
and your users may expect this. If not, then you have a far freer hand.

Yours

Mark B



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/How-to-read-the-value-of-bookmarks-docx-tp5710184p5712027.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]

Reply via email to