Forum


Replies: 1   Views: 3559
Template variable substitution using other documents
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 Philippe GAUTHIER  · 07-11-2015 - 10:06

Hello,

We use PhpDocx in a document generation engine, which substitutes multiple variables from user defined templates. The sources are loaded from a domain model, and the engine handles all that using two kind of substitution : simple text and html (written by users in web editors).

We are studying the possibility of integrating other docx documents inside a variable, in the same fashion as we do for html. As PhpDocx implements WordML substitution (replaceVariableByWordML), I think this should be quite straightforward, but this scenario is not documented (or maybe I missed it).

So the questions :

Is it possible to obtain the WordML code of the body of an existing Word document (don't care about header, footer and other parts) ? Is this code directly usable in WordML fragment or need some treatment (extraction, replacement) ?

Thanks in advance.