通过com调用word组件,<? 
// 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();  
?>

解决方案 »

  1.   

    upto wyx726(海风习习) 
    你自己测试过这段代码吗??
    我也看了php帮助文档,可是还是不行,
      

  2.   

    是不是这个word.application没有注册过???
    出错信息是:
    Loaded word version (9.0) 
    Warning: (null)(): Invoke() failed: 发生意外。 Source: Microsoft Word Description: 无法打开宏储存。 in C:\xcgs\924.php on line 5Warning: (null)(): Invoke() failed: 发生意外。 Source: Microsoft Word Description: 集合所要求的成员不存在。 in C:\xcgs\924.php on line 7
      

  3.   

    看看这篇文章能不能有所收获
    http://www.phpbuilder.com/columns/venkatesan20030501.php3