COM in PHP (winows only)
程序员文章站
2022-11-25 14:55:20
找了很久,终于给我找到!哈哈哈... //听说php4也已经支持java/ejb的说. //...
找了很久,终于给我找到!哈哈哈...
//听说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支持.
//听说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支持.
上一篇: 这个目标比较靠谱
下一篇: 使用数据库保存session的方法