The workaround that others found and posted is as follows,
[code]
/*
* Old code that was working but gave corrupt file that had to be recovered.
*/
//$docx->createDocx('../phpdocx/phpdocx_pro/Output/MPS_Assessment');
//$docx->createDocxAndDownload('../phpdocx/phpdocx_pro/Output/test');
$filename = '../phpdocx/phpdocx_pro/Output/test';//<< My document is going to be called Test and placed in a directory.
$docx->createDocx($filename);//<< Create my Document
unset($docx);
header("Content-Type: application/vnd.ms-word");
header("Content-Length: ".filesize($filename.'.docx'));
header('Content-Disposition: attachment; filename=MPS_Assessment.docx');
header('Content-Transfer-Encoding: binary');
ob_clean();
flush();
readfile($filename.'.docx');//<< Sends the file to the user for download
unlink($filename.'.docx');//<< removes the file from the server for security reasons, comment out to keep if you want to retain a copy.
exit;//<< REQUIRED TO STOP THE ANNOYING CORRUPT NOTICE
[/code]
Hope this helps you out, all credit to the original writers that posted over on stackoverflow
jc