欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

COM in PHP (winows only)

程序员文章站 2022-05-21 12:26:17
...
找了很久,终于给我找到!哈哈哈... 
//听说php4也已经支持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支持.