Forum


Replies: 2   Views: 4473
Replacevariablebytext problem
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 IanTechnoReadapt  · 13-06-2014 - 23:22

In your example, you are missing a closing parenthesis on the line $docx->replaceVariableByText(array('NAME' => 'John Smith'); should be $docx->replaceVariableByText(array('NAME' => 'John Smith')); Otherwise, does replaceVariableByText works in headers? I'm trying to generate a word file that have a variable company name in the headers of some pages. placing $COMPANY_NAME$ in the headers of my template doesn't do the trick.