note 60306 deleted from class.com by mazzanet
| From: | mazzanet@php.net | Date: | Tue, 03 Jan 2006 10:14:12 +0000 |
| Subject: | note 60306 deleted from class.com by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101141@lists.php.net to get a copy of this message | ||
Note Submitter: candy at teamrise dot com dot tw
----
i am call COM, my script
<?php
// starting word
$word = new COM("Excel.application") or die("Unable to instanciate Word");
print "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->Release();
$word = null;
?>
but test it. show
Loaded Word, version 11.0n
Fatal error: Uncaught exception 'com_exception' with message 'Error
Qs¬õB ' in D:\TRSMTP\www\word.php:20 Stack trace: #0
D:\TRSMTP\www\word.php(20): com->Release() #1 {main} thrown in D:\TRSMTP\www\word.php on line 20
why?