Hi, I'm trying to read a MS word doc, I found these code on a blog which uses COM , but when I run this PHP code I get an exception :
"
com_exception Object ( [message:protected] => Source: Microsoft Word
Description: The requested member of the collection does not exist. [string:Exception:private] =>
[code:protected] => -2147352567 [file:protected] => C:\wamp\www\PhpProject1\index.php [line:protected] => 31 [trace:Exception:private] => Array ( [0] => Array ( [file] => C:\wamp\www\PhpProject1\index.php [line] => 31 [function] => unknown ) ) [previous:Exception:private] => )
"
here is the code
$filename="cv.doc";
$TXTfilename = $filename . ".txt";
$word = new COM("word.application") or die("Unable to instantiate Word object");
$word->Documents->Open($filename);
// the '2' parameter specifies saving in txt format
$word->Documents[1]->SaveAs($TXTfilename ,2);
$word->Documents[1]->Close(false);
$word->Quit();
$word->Release();
$word = NULL;
unset($word);
$content = file_get_contents($TXTfilename);
unlink($TXTfilename);
I read from here " http://ir2.php.net/manual/en/com.installation.php " that I don't need to install COM but I need to install some COM objects like for MS word doc, but I don't know how to fix it, any idea? thanks in advance