通过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();
?>
// 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();
?>
你自己测试过这段代码吗??
我也看了php帮助文档,可是还是不行,
出错信息是:
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
http://www.phpbuilder.com/columns/venkatesan20030501.php3