Page 1 of 1

how can xampp's php call the COM

PostPosted: 25. July 2005 19:18
by doctorli
<?php
// Load the appropriate type library.
com_load_typelib('Word.Application');
// Create an object to use.
$word = new COM('word.application') or die('Unable to load Word');
print "Loaded Word, version {$word->Version}\n";
// Open a new document with bookmarks of YourName and YourAge.
$word->Documents->Open('D:/apache/Projects/ham/ham_file/Unfilled1.DOC');
?>

xampp can't call the COM, does anyone know how to do this ?

PostPosted: 25. July 2005 21:24
by Wiedmann
Hm, any error message?

i use XAMPP Windows 1.4.14

PostPosted: 26. July 2005 17:44
by doctorli
When I run:
<?
// Load the appropriate type library.
com_load_typelib('Word.Application');
// Create an object to use.
$word = new COM('word.application') or die('Unable to load Word');
print "Loaded Word, version {$word->Version}\n";
// Open a new document with bookmarks of YourName and YourAge.
$word->Documents->Open('c:/test/math.doc');
?>

it say: Uncaught exception 'com_exception' with message 'Failed to create COM object `word.application'

i use XAMPP Windows 1.4.14

PostPosted: 26. July 2005 17:58
by Wiedmann
it say: Uncaught exception 'com_exception' with message 'Failed to create COM object `word.application'

Which function raise this error? No "in line ..." in the output?

How did you start Apache?