Forum


Replies: 1   Views: 3037
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.

Posted by admin  · 17-04-2016 - 08:05

Hello,

That's a generic error that Word shows when some content added is wrong. The source vary: non UTF8 characters, a non valid image...

After you purchase a license please send us the DOCX and we'll check it to give a solution. A trial package can't be debugged.

Regards.