Replies: 4   Views: 4155
Highlight/background color for templatevariable
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by jorgelj  · 17-10-2013 - 09:28


I recommend you replaceTemplateVariableByHtml. Please try this code:

$html = '<span style="font-family: Arial;font-size:11pt;background-color: yellow;">9</span>';

$docx->replaceTemplateVariableByHtml('FIELD_BK', 'inline', $html);