title: Replacing variables in a word document template with java
body: <p>I want to load a template word document to add content to and save as new document. I'm working on .doc file. </p>
  
  <p>After a long research I only found solutions for docx : </p>
  
  <p><a href="http://www.smartjava.org/content/create-complex-word-docx-documents-programatically-docx4j" rel="noreferrer">http://www.smartjava.org/content/create-complex-word-docx-documents-programatically-docx4j</a> </p>
  
  <p><a href="http://www.sambhashanam.com/mail-merge-in-java-for-microsoft-word-document-part-i/" rel="noreferrer">http://www.sambhashanam.com/mail-merge-in-java-for-microsoft-word-document-part-i/</a></p>
  
  <p>So I want to replace any variable written in this format: <code>$VAR</code> by its value. 
  Can I do it with velocity or Apache-poi, what is the best solution for it.
  Any help will be appreciated.</p>