Forum


Replies: 1   Views: 5855
Ms word says document is corrupt but is fine on opening it
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 anjanesh  · 15-04-2016 - 14:33

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.