Hi,
Having issues with replaceVariableByHTML to replace a tag in a Word file, and trying to format this replaced HTML code from CKEditor to a customised Word Style (font2) that is already in the Word Template. It works fine with addText, though just doesn't work with replaceVariableByHTML.
Any idea what I am doing wrong?
Test code below:
<?php
require_once '../phpdocx_corporate-new/classes/CreateDocx.inc';
$docx = new CreateDocxFromTemplate('template4.docx');
$styles = array('pStyle' => 'font2');
$docx->replaceVariableByHTML('PIC', 'block', '<p>This lack of <span style="color:#FF0000">detail</span> could mean a system does not <span style="background-color:#00FFFF">function correctly.</span></p>
', array('isFile' => false,'wordStyles' => $styles));
$docx->addText('This is some sample paragraph test', array('pStyle' => 'font2'));
$docx->createDocx('test4');
header("Content-type:application/vnd.openxmlformats-officedocument.wordprocessingml.document");
header("Content-disposition:attachment;filename=test4");
readfile('test4.docx');
?>