From 25575c80ca1ec1a496eba09882a9cada56626190 Mon Sep 17 00:00:00 2001 From: Erik Hazington <83652897+hazington@users.noreply.github.com> Date: Fri, 30 Dec 2022 21:34:47 +0100 Subject: [PATCH] Add background color support for text boxes for Word writer --- src/PhpWord/Writer/Word2007/Element/TextBox.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PhpWord/Writer/Word2007/Element/TextBox.php b/src/PhpWord/Writer/Word2007/Element/TextBox.php index d264f084..54db9285 100644 --- a/src/PhpWord/Writer/Word2007/Element/TextBox.php +++ b/src/PhpWord/Writer/Word2007/Element/TextBox.php @@ -50,6 +50,9 @@ class TextBox extends Image $xmlWriter->startElement('v:shape'); $xmlWriter->writeAttribute('type', '#_x0000_t0202'); + if ($style->getBgColor()) { + $xmlWriter->writeAttribute('fillcolor', $style->getBgColor()); + } $styleWriter->write(); $styleWriter->writeBorder();