明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺!

COM in PHP (winows only)

[摘要]找了很久,終于給我找到!哈哈哈... //聽說php4也已經(jīng)支持Java/EJB的說. <? // this script is come from zend. :) word = new COM("word.application") or die("...
找了很久,終于給我找到!哈哈哈...  
//聽說php4也已經(jīng)支持Java/EJB的說.  
<?  
// 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()看看你的機器是否打開了COM支持.