COM in PHP (winows only)
发布时间:2006-10-14 2:41:53   收集提供:gaoqian
找了很久,终于给我找到!哈哈哈...  
//听说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支持.  
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50