Hi!
I am using PHP + COM to open MS Word then I open a word document and save it as HTML.
Sometimes users pass to my function a corrupted MS Word file or even password protected file. When I try to open it using PHP script hangs and the instance of MS Word stays in memory. I can not even kill that process using "end task". Is there a way to make MS Word exit if any error occures or test if the file is corrupted or something like that which could avoid computer crash.
There is however another opportunity - I could use a command line tool with MS Word to HTML or XML convertation which does not open MS Word.
I have Windows 2000/Apache and PHP4.0.4pl1 as Apache module
this is MS Word saving part
$word =new COM("word.application") or error("Unable to instantiate word");
//$word->Application->Visible = 1;
$word->Documents->Open($Doc,0,1);
// with number 8 I have a word to html converter
$word->Documents[1]->SaveAs($HTMLDoc,8);
$word->Quit();
unset ($word);
-Arnis