Forum


Replies: 6   Views: 5008
External file and replace variable
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 rushfordk  · 22-08-2014 - 14:59

hi I load several external file to create a new document with a table of content. For the 1 document i create a docx from template and the variable are replace like i wish too but in the other document they were not replace. Is there a way to find and replace in a create document with external file?

Posted by admin  · 25-08-2014 - 09:39

Hello, You can use the method replaceVariableByExternalFile. Please check the available documentation: http://www.phpdocx.com/api-documentation/templates/replace-variable-external-file-Word-document Regards.

Posted by rushfordk  · 25-08-2014 - 14:51

i dont want to replace a placeholder by a whole document. i want to replace a word in a external file i load after a load the templace. i just want to do "find and replace" ty

Posted by admin  · 25-08-2014 - 16:02

Hello, What do you mean by 'a word in a external file i load after a load the templace. i just want to do "find and replace" ty '? Sorry but we don't understand the sentence. What license of phpdocx are you using? Please check the 'Templates' section on the API documentation: http://www.phpdocx.com/documentation/api-documentation Regards.

Posted by rushfordk  · 25-08-2014 - 17:58

Ok 1 i load a template with placeholder in it. (this part work find) 2- i add a table of contents 3- i load a externalfill in the new document. (in this document we have the same placeholder ) so we have a new document with a template, a table of content and a external file. 4- i use replaceVariableByText the replace text work in the template part but doesnt work in the part comming from the external file. I wish to make a bif word file with the content of several other document depending of what the user want i hope im more clear english is not my 1 language.

Posted by admin  · 26-08-2014 - 06:31

Hello, You need to replace the placeholder in the document before adding it. Regards.

Posted by rushfordk  · 26-08-2014 - 17:44

oh ok. now it working perfect ty