I want to convert a word file to txt file my code is here.
Please help me
$filename="http://localhost/doctxt/assd.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 received following arror :
Fatal error: Call to undefined method variant::SaveAs() in C:\wamp\www\doctxt\index.php on line 8

New Topic/Question
Reply




MultiQuote



|