Forum


Replies: 3   Views: 244
Replace text in template (no placeholders)
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 ordersvrc  · 08-05-2024 - 16:12

Is there a way using some of the search and replace word content features are another method to replace text that is in a template file.  Right now the replaceVariableWith... methods require symbols.  This text I am trying to replace would not be a PLACEHOLDER and not be surrounded by symbols, etc.

Posted by admin  · 08-05-2024 - 16:17

Hello,

You can use searchAndReplace available in Advanced and Premium licenses to search and replace texts not wrapped by placeholder symbols used by template methods.

Regards.

Posted by ordersvrc  · 08-05-2024 - 16:51

Yes I am aware of that method for DocxUtilities.  That would require me to build the file using template, then run this.  I was hoping to do this all using createdocxfromtemplate.

Posted by admin  · 08-05-2024 - 17:05

Hello,

Methods included in CreateDocxFromTemplate require using template placeholder symbols ($VAR$, ${VAR}...). searchAndReplace is available in DocxUtilities.

Regards.