Forum


Replies: 1   Views: 576
Search for word in document and give it red font color
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 philip0908  · 19-05-2022 - 13:18

Hello,

am I right that I need the premium license to search for every appearance of a word (e.g. "CONFIDENTIAL") in a document to then give all such appearances red font color?

Best and thanks,

Philip

Posted by admin  · 19-05-2022 - 13:44

Hello,

Advanced (and Premium) licenses includes the searchAndHighlight method to search and highlight strings (strings that don't use template symbols so they can't be replaced using template methods). Maybe it's enough for your needs.

Premium licenses include DOCXCustomizer to change styles on-the-fly, but the content to be changed must be queried as XML element, so it may not work for all your contents (because maybe they can't be queried standalone).

If you upgrade your license to Premium, we also recommend you include LUS with the upgrade, the dev team can send to your email a new searchAndColor method to search and color strings (as searchAndHighlight does now but applying a text color).

Regards.