title: Docx4j variableReplace with styling
body: <p>I want to creating new Word document from a model document (.docx) and replace some text with styling.</p>
  <p>How can I style the <code>firstName</code> in Bold and <code>message</code> as yellow highlight color?</p>
  <p>My Code is below:</p>
  <pre class="lang-java prettyprint-override"><code>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(templateInputStream);
  
  MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
  
  VariablePrepare.prepare(wordMLPackage);
  
  HashMap&lt;String, String&gt; variables = new HashMap&lt;&gt;();
  variables.put(&quot;firstName&quot;, &quot;fileName123&quot;);
  variables.put(&quot;lastName&quot;, &quot;lastName345&quot;);
  variables.put(&quot;message&quot;, &quot;messsssssss&quot;);
  
  documentPart.variableReplace(variables);
  
  ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
  
  wordMLPackage.save(outputStream);
  
  return outputStream.toByteArray();
  </code></pre>
  <p>A screenshot of my starting model [sic: template] docx is shown below:</p>
  <p><a href="https://i.stack.imgur.com/zW686.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zW686.png" alt="screenshot" /></a></p>
  <p>A screenshot of my expected result is the following:</p>
  <p><a href="https://i.stack.imgur.com/fSZqM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fSZqM.png" alt="enter image description here" /></a></p>