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/
fatal error regonising COM
Moderator: General Moderators
-
sujithtomy
- Forum Commoner
- Posts: 46
- Joined: Tue Mar 24, 2009 4:43 am
Re: fatal error regonising COM
Hello,
Please check your php info whether your php configured with COM
i think you need php5
Please check your php info whether your php configured with COM
i think you need php5
Requirements
COM functions are only available for the Windows version of PHP.
.Net support requires PHP 5 and the .Net runtime.
Installation
There is no installation needed to use these functions; they are part of the PHP core.
The windows version of PHP has built in support for this extension. You do not need to load any additional extension in order to use these functions.
You are responsible for installing support for the various COM objects that you intend to use (such as MS Word); we don't and can't bundle all of those with PHP.