fatal error regonising COM
Posted: Thu Mar 26, 2009 9:27 am
There is a problem in line 7 which ive highlighted in blue with the php code
the error that comes up is
Fatal error: Class 'COM' not found in /nfs/mntI4/projectsite/J.K.Childs/wordtotxt.php on line 7
<?
$filename="APPENDIX A.doc";
$TXTfilename = $filename . ".txt";
$word = new COM("word.application") or die("not able to convert the word document");
$word->testing/->Open($APPENDIX A.doc);
// the '2' parameter specifies saving in txt format
$word->testing/[1]->SaveAs($TXTfilename ,2);
$word->testing/[1]->Close(false);
$word->Quit();
$word->Release();
$word = NULL;
unset($word);
$content = file_get_contents($TXTfilename);
unlink($TXTfilename);
?>
I got the code for this from the following website http://snipplr.com/view/8364/convert-wo ... text-file/
the error that comes up is
Fatal error: Class 'COM' not found in /nfs/mntI4/projectsite/J.K.Childs/wordtotxt.php on line 7
<?
$filename="APPENDIX A.doc";
$TXTfilename = $filename . ".txt";
$word = new COM("word.application") or die("not able to convert the word document");
$word->testing/->Open($APPENDIX A.doc);
// the '2' parameter specifies saving in txt format
$word->testing/[1]->SaveAs($TXTfilename ,2);
$word->testing/[1]->Close(false);
$word->Quit();
$word->Release();
$word = NULL;
unset($word);
$content = file_get_contents($TXTfilename);
unlink($TXTfilename);
?>
I got the code for this from the following website http://snipplr.com/view/8364/convert-wo ... text-file/