sad_sam19 Posted May 22, 2008 Share Posted May 22, 2008 hello everyone! I am working on a project that will create a Word document. On my computer, it is working properly. But on the server where i loaded the program it has errors. I just got one question, does COM class will not work on a computer if it does not have MS Office installed on it? I already checked the Component Services, etc.. But it still not working properly,. the error goes like this.. Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `word.Application': Invalid syntax ' in D:\webservr\ins_monitoring\REPORTS\prepare_renewal_advice.php:43 Stack trace: #0 D:\webservr\ins_monitoring\REPORTS\prepare_renewal_advice.php(43): com->com('word.Applicatio...') #1 D:\webservr\ins_monitoring\REPORTS\ForRenewalThisMonth.php(33): include('D:\webservr\ins...') #2 {main} thrown in D:\webservr\ins_monitoring\REPORTS\prepare_renewal_advice.php on line 43 please help :'( thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/106750-solved-com-class/ Share on other sites More sharing options...
GingerRobot Posted May 22, 2008 Share Posted May 22, 2008 Yes, to use the COM to create a word document, you do need to have Word installed. I believe you can work around this either by creating RTF documents which word can open anyway, or creating HTML pages but setting the content type to a word document. If you google, you should find examples. Quote Link to comment https://forums.phpfreaks.com/topic/106750-solved-com-class/#findComment-547210 Share on other sites More sharing options...
mlin Posted May 22, 2008 Share Posted May 22, 2008 "HTML pages but setting the content type to a word document" that's probably the best answer you can get, but don't work too hard on it since MS doesn't conform to standards therefore word will expect the html to be MS way, not the right way. Install office and keep on going, or better yet, go *nix and create pdf's? Quote Link to comment https://forums.phpfreaks.com/topic/106750-solved-com-class/#findComment-547234 Share on other sites More sharing options...
GingerRobot Posted May 22, 2008 Share Posted May 22, 2008 or better yet, go *nix and create pdf's? Quite possibly the best solution -- can be done under windows too. Quote Link to comment https://forums.phpfreaks.com/topic/106750-solved-com-class/#findComment-547257 Share on other sites More sharing options...
mlin Posted May 22, 2008 Share Posted May 22, 2008 Yeah, I just mention'd *nix since if they no longer need office, they might as well abandon winblows for something that owns 99% of server market for a reason. And *nix distros are usually free as in speech, you can do anything you want...even modify their programs. Since when did you have access to source code for stuff that matters on a proprietary system. Quote Link to comment https://forums.phpfreaks.com/topic/106750-solved-com-class/#findComment-547260 Share on other sites More sharing options...
sad_sam19 Posted May 23, 2008 Author Share Posted May 23, 2008 ok thanks for all your help!,. Quote Link to comment https://forums.phpfreaks.com/topic/106750-solved-com-class/#findComment-547910 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.