Forum


Replies: 3   Views: 2551
Highlight block of text in docx template
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 arnaudbouchard  · 31-10-2017 - 06:39

Hi there,

We are working with docx templates and looking for a way to highlight a particular block of text instead of removing it.

For example, we might have a docx template with a paragraph enclosed in block placeholders:

$BLOCK_varName$

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

$BLOCK_varName$

But instead of using:

$docx->deleteTemplateBlock('varName')

We want to highlight this text in a different color.

How would you do this?

 

Thanks in advance,

Arnaud