It's a very hard question and I searched for it and I didn't find any good answer! I want to read (key) Bookmarks of Ms Word and set the vlaue in Word with Java program language! how can I do it? with Apache POI didn't work! :( thanks
2 Answers
Ok I've found the solution, and wrote the program. this link maybe help you! http://apache-poi.1045710.n5.nabble.com/How-to-read-the-value-of-bookmarks-docx-td5710184.html but it's just for new Ms Word (.docx) For old version (.doc) I wrote a method by my self but it didn't work correctly. for old version we should use org.apache.poi.hwpf but for new version org.apache.poi.xwpf! and for controlling Ms Word or MS Office we should use Jacob Project. If you have questions you can ask me again

- 425
- 1
- 5
- 11
You could do this with docx4j.
The challenge is that bookmarks are point tags which surround arbitrary content.
So if your intent is to replace the content of a bookmark, you'd be better off considering an alternative approach.
See this presentation for suggestions.

- 15,352
- 4
- 44
- 84