Hello,
I have a Word document with a couple of placeholders that I want to replace. Some of the placeholders are formatted, e.g. in bold, italic, and so on.
However, I wanted the replacements to be highlighted in yellow, so I can clearly see, where I need to doublecheck.
When I got a formatted document like this:
This is a text with a $Variable$.
I want the outcome to be like this:
This is a text with a replaced Text. (Also highlighted in yellow but this editor cannot do this).
However, the texts comes like this:
This is a text with a replaced Text. (Also highlighted in yellow but this editor cannot do this).
My code:
...
$docx = new CreateDocxFromTemplate($document);
$word_fragment = new WordFragment($docx);
$word_fragment->addText("replaced Text", array("highlightColor" => "yellow"));
$docx->replaceVariableByWordFragment(array("Variable" => $word_fragment), $options);
Any ideas/help?