Replies: 7   Views: 2358
Replacevariablebytext on wordfragment
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 admin  · 03-10-2017 - 07:44


You can use the replaceVariableByText method after the WordFragment has been added. But the addExternalFile method uses an altChunk tag; these external files aren't transformed to MS Word format but added as external files, so you can't 'manipulate' their contents.

We recommend using embedHTML to add HTML and mergeDOCX to merge DOCX documents; using both methods you get MS Word contents that can be changed. If you need to merge other document formats, they can be transformed to DOCX using the conversion plugin.

If you need to change styles or tags on the fly you can use DOCXPath or DOCXCustomizer.