Forum


Replies: 5   Views: 2999
Unable to remove the highlighted word from ms word
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 sandeep.cm  · 08-06-2017 - 14:02

Hello,
I am highlighting a word in HTML format. My code is:

<?php
require_once '../../../classes/CreateDocx.inc';

$docx = new CreateDocxFromTemplate('../../files/TemplateHTML.docx');

$docx->replaceVariableByHTML('ADDRESS', 'inline', '<p style="font-family: verdana; font-size: 11px">C/ Matías Turrión 24, Madrid 28043 <b style="color: white;background: red;">Spain</b></p>', array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => false));

$docx->createDocx('example_replaceTemplateVariableByHTML_1');
?>


 O/P DOCX File: https://goo.gl/BUhAFQ
 
 My problem is I cannot remove the red highlight from the word using "No Color" MS Word option.

Posted by admin  · 08-06-2017 - 14:17

Hello,

Your username doesn't have any license tied. Which license and version of phpdocx are you using?

Regards.

Posted by sandeep.cm  · 08-06-2017 - 14:54

I'm using PHPdocX 6.0 under Basic License purchased for autocrit.com.

Posted by admin  · 08-06-2017 - 16:26

Hello,

We have checked it and we can remove the background color.

It's not a highlight color but a background color; you just need to select the text and remove or set a new shading value to the text. When you select the text a small dialog appears.

Regards.

Posted by sandeep.cm  · 08-06-2017 - 16:44

I'm testing it on MS Word 2010. On hovering over the text, we can change the background color to anything. When we choose "No Color" as text highlight color, it is supposed to remove the red color but it isn't doing so. The word is highlighted using the PHPDOCX code mentioned above.

See screenshot: https://goo.gl/VE45gm

Posted by admin  · 08-06-2017 - 17:29

Hello,

We have tested it using MS Word 2010 and it works fine too.

As we tried to explain on our previous update, you're trying to remove a highlight color, and that color is not a hightlight but a shading color (we have changed the white color of the word to a black one just to show it):

http://imgur.com/a/GYX6b

Regards.