|<?php // starting word $word = new COM("word.application") or die("Unable to instantiate Word"); echo "Loaded Word, version {$word->Version}\n";
//bring it to front $word->Visible = 1;
//open an empty document $word->Documents->Add();
//do some weird stuff $word->Selection->TypeText("This is a test..."); $word->Documents[1]->SaveAs("Useless test.doc");
//closing word $word->Quit();
//free the object $word = null; ?>
i have called this page testcom.php but when i try and view it with a clients browser i get this error:
[client xxx.xxx.xxx.xxx] PHP Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Word.application': Invalid syntax\r\n' in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\testcom.php:3\nStack trace:\n#0 C:\\Program Files\\Apache Group\\Apache2\\htdocs\\testcom.php(3): com->com('Word.applicatio...')\n#1 {main}\n thrown in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\testcom.php on line 3
|
Has anyone seen this error before or know what it means? Or if possible does anyone know of any good docs on using com with php?
Thanks in advance for any help!!
Cheers
Bob
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php