Replies: 1   Views: 2215
Replacevariablebywordfragment on link
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 sato2010  · 24-11-2017 - 11:59

Hi, i try replace variable in document, all right if plain text

If link variable no change.

Sample if open document, link inside no change and stay with variable

link - "Hello $INS$world  "

Another variable in text replaced right

Posted by admin  · 24-11-2017 - 12:08


What version and license of phpdocx are you using? placeholders are added as text strings (or alt text for images), but a link is not added as a text string but an internal XML content. You can add a text placeholder (not a link) and then replace it by a WordFragment link with all licenses; or use the rawSearchAndReplace method to replace internal placeholders, this method is available in Advanced and Premium licenses.

On the rawSearchAndReplace API page you can see an example about replacing a link with an internal placeholder.