adam291086 Posted October 5, 2007 Share Posted October 5, 2007 I am trying to use Com to open a word document. But i get the error below. As i have used a tutorial i am not sure how to solve the problem. Any ideas Fatal error: Cannot instantiate non-existent class: com in /homepages/12/d214897219/htdocs/adam/test code/file_get_contents().php on line 11 <?php set_time_limit(0); error_reporting(E_ALL); $word = new COM('word.application') or die('Unable to load Word'); $word->Documents->Open('adam.doc'); ?> Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/ Share on other sites More sharing options...
Guardian-Mage Posted October 5, 2007 Share Posted October 5, 2007 please tell us which line of code is line 11, and are you sure it should be $word = new COM('word.application') or die('Unable to load Word'); not $word = new COM(word.application) or die('Unable to load Word'); Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/#findComment-362328 Share on other sites More sharing options...
adam291086 Posted October 5, 2007 Author Share Posted October 5, 2007 line 11 is $word = new COM(word.application) or die('Unable to load Word'); i have also tried removing the ' ' around (word.application) but still geting the same problem. Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/#findComment-362333 Share on other sites More sharing options...
Guardian-Mage Posted October 5, 2007 Share Posted October 5, 2007 Also which version of PHP are you using Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/#findComment-362334 Share on other sites More sharing options...
adam291086 Posted October 5, 2007 Author Share Posted October 5, 2007 5.0 Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/#findComment-362335 Share on other sites More sharing options...
Guardian-Mage Posted October 5, 2007 Share Posted October 5, 2007 Is this on your computer on localhost, and if so it is a problem with your config files for PHP. Just update to PHP 5.2.4 and it should fix it. If not on localhost, I cant help you much, but you can read this: http://ca.php.net/com Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/#findComment-362336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.