I suspect that is happening because you did not bookmark the text but simply
inserted the bookmark into the document in front of the Hello world phrase. 

To see what I mean, try typing another phrase into the document say /to
replace/ for example. Now select that text as if you were going to change
the font or size but instead select the Insert->Bookmark menu options, type
a name for the bookmark into the box that appears and select Add. Now you
should have created a piece of text that is itself bookmarked and the code
ought to replace it for you. Off of the top of my head, I cannot remember
how to trun on the option but it is possible to tell Word to display the
start and end points of bookmarks in the text. You should see and opening [
symbol in the text to show where a bookmark begins and a matching ] to show
where it ends. Try to find out how to turn this on (I think it is somewhere
in the options settings) and I think it will show you that your original
example looks like this ][Hello world

Yours

Mark B

PS If you intend to use this code in a production environment, please test
it throughly.



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