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'); ?> Quote 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'); Quote 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. Quote 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 Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/71939-solved-question/#findComment-362336 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.