关于php的com组件问题
本人写的代码如下?php $word=new COM(word.application) or die(have a error); // echo $word-Version; $word-Visible=1; $word-Documents-Add(); $word-Selection-TypeText(this is test.........); $word-Documents[1]-SaveAs(test.doc); $word-Qui
本人写的代码如下
<?php
$word=new COM("word.application") or die("have a error");
// echo $word->Version;
$word->Visible=1;
$word->Documents->Add();
$word->Selection->TypeText("this is test.........");
$word->Documents[1]->SaveAs("test.doc");
$word->Quit();
$word=null;
?>
出现错误如下:
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Word<br/><b>Description:</b> 命令失败' in G:\mysql\apache\htdocs\playecshop\com.php:11 Stack trace: #0 G:\mysql\apache\htdocs\playecshop\com.php(11): variant->SaveAs('test.doc') #1 {main} thrown inG:\mysql\apache\htdocs\playecshop\com.php on line 11
是什么原因:求高手指导
<?php
$word=new COM("word.application") or die("have a error");
// echo $word->Version;
$word->Visible=1;
$word->Documents->Add();
$word->Selection->TypeText("this is test.........");
$word->Documents[1]->SaveAs("test.doc");
$word->Quit();
$word=null;
?>
出现错误如下:
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Word<br/><b>Description:</b> 命令失败' in G:\mysql\apache\htdocs\playecshop\com.php:11 Stack trace: #0 G:\mysql\apache\htdocs\playecshop\com.php(11): variant->SaveAs('test.doc') #1 {main} thrown inG:\mysql\apache\htdocs\playecshop\com.php on line 11
是什么原因:求高手指导
<?php $word=new COM("word.application") or die("have a error"); // echo $word->Version; $word->Visible=1; $word->Documents->Add(); $word->Selection->TypeText("this is test........."); $word->Documents[1]->SaveAs("test.doc"); $word->Quit(); $word=null; ?> 出现错误如下: Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Word<br/><b>Description:</b> 命令失败' in G:\mysql\apache\htdocs\playecshop\com.php:11 Stack trace: #0 G:\mysql\apache\htdocs\playecshop\com.php(11): variant->SaveAs('test.doc') #1 {main} thrown inG:\mysql\apache\htdocs\playecshop\com.php on line 11 是什么原因:求高手指导
- 上一篇:遍历目录
- 下一篇:PHP Laravel 框架 扩展自己需要的 Auth 模块
精彩图集
精彩文章