COM in PHP (winows only)
更新時(shí)間:2006年10月09日 00:00:00 作者:
找了很久,終于給我找到!哈哈哈...
//聽(tīng)說(shuō)php4也已經(jīng)支持Java/EJB的說(shuō).
<?
// this script is come from zend. :)
$word = new COM("word.application") or die("Unable to instanciate Word
");
print "Loaded Word, version {$word->Version}n";
$word->Visible = 1;
$word->Documents->Add();
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
$word->Quit();
?>
注意:先用phpinfo()看看你的機(jī)器是否打開(kāi)了COM支持.
//聽(tīng)說(shuō)php4也已經(jīng)支持Java/EJB的說(shuō).
<?
// this script is come from zend. :)
$word = new COM("word.application") or die("Unable to instanciate Word
");
print "Loaded Word, version {$word->Version}n";
$word->Visible = 1;
$word->Documents->Add();
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
$word->Quit();
?>
注意:先用phpinfo()看看你的機(jī)器是否打開(kāi)了COM支持.
相關(guān)文章
類(lèi)的另類(lèi)用法--數(shù)據(jù)的封裝
類(lèi)的另類(lèi)用法--數(shù)據(jù)的封裝...2006-10-10
PHP_MySQL教程-第二天while循環(huán)與數(shù)據(jù)庫(kù)操作
PHP_MySQL教程-第二天while循環(huán)與數(shù)據(jù)庫(kù)操作...2007-03-03

