I'm using the trial version of phpdocx and it goes like this :
...
$docx->replaceVariableByText($variables);
$docx->replaceVariableByText($variables_header, ['target' => "header"]);
...
$docx->embedHTML($html);
$docx->createDocxAndDownload('temp/Business Plan');
All is fine. When I open it in Libre Office, it shows up fine.
But when I open it in Microsoft Word, I get this error : http://i.imgur.com/e70KZFc.jpg
The next is if you click "Details" on the initial Word Error Screen (you'll see the new text at the bottom of the image) : http://i.imgur.com/ixAp3Lp.jpg
The final one is the new error message that appears when you click "OK" on the initial Word Error Screen : http://i.imgur.com/evwWyYe.jpg
"We're sorry. We can't open [document name] because we found a problem with its contents." and "Word found unreadable content in [document name]. Do you want to recover the contents of this document? If you trust the source of this document, click Yes."
Is there any way to resolve this ? Everything is fine in the docx when I click on OK. But I need to get rid off this error.