Hello,
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);
Regards.
🏷️ Limited Offer: 25% OFF 🏷️
First 100 purchases only — Special discount!
Use this coupon on checkout: PHPDXPJ_D1SC1N5T
Get it now