title: Docx4j Set a value on Bookmark
body: <p>I'm recently using the docx4j and i'm trying to set a bookmark on a Word document (it's my template file).</p>
  
  <p>I already see the manual but i don't find the answer :S</p>
  
  <p>I'm using version 2.8.1 and i'm getting a Bookmark based on the code available <a href="http://www.docx4java.org/forums/docx-java-f6/bookmarks-and-templates-advice-t681.html" rel="nofollow">http://www.docx4java.org/forums/docx-java-f6/bookmarks-and-templates-advice-t681.html</a> (thanks, freemink).</p>
  
  <pre><code>  PbookmarkedParagraphInPart = findBookmarkedParagraphInPart(documentPart, "bookmarktest");
  
    // 3. copy the found paragraph to keep styling correct
    P copy = (P) XmlUtils.deepCopy(bookmarkedParagraphInPart);
  
    String ptext = "Testing";
  
    // replace the text elements from the copy
    List&lt;?&gt; texts = getAllElementFromObject(copy, Text.class);
    if (texts.size() &gt; 0) {
       Text textToReplace = (Text) texts.get(0);
       textToReplace.setValue(ptext);
    }
  
    // add the paragraph to the document
    bookmarkedParagraphInPart.getContent().add(copy);
  </code></pre>
  
  <p>With this code my ptext is set on bookmark location but not inside of bookmark :/</p>
  
  <p>I also retrieve the CTBookmark but there is no method to set a value here.</p>
  
  <p>Can anybody help, please?</p>