dongtuo7364 2013-11-13 14:02
浏览 30
已采纳

PHP和Word文档创建问题

Below is the code snippet I'm using but I get the error underneath when executing it and can't seem to figure it out, I'm using PHP 5.3.27, it all worked fine in PHP 4 which I'm upgrading from.

$vObjBookmark = $this->mWord->ActiveDocument->Bookmarks($pBookmarkName);
$vRange = $vObjBookmark->Range;
$vTable = $this->mWord->ActiveDocument->Tables->Add($vRange, $pRows+1, $pCols, 0, 2);
@$vTable->Borders->Shadow = TRUE;
$vTable->AllowAutoFit = 1;
$vTable->AutoFitBehavior(0);

@$vTable->Borders->Shadow = TRUE; is on line 436 which seems to throw the error.

Error being thrown:

Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft Word
Description: Command failed' in genworddoc_class.php:436
Stack trace:
#0 genworddoc_class.php(436): genWordDoc::addFormattedTable7()
#1 genworddoc_class.php(330): genWordDoc->addFormattedTable7('BULK_TABL...', 1, 5, Array, Array, Array)
#2 c_generate_correspondence.php(444): genWordDoc->addTableArrayObjectsToTemplate('BULK_TABL...', Array, Array, NULL, NULL, Array)
#3 main.php(190): include('C:\htdocs\...')
#4 index.php(6): include('C:\htdocs\...')
#5 {main} thrown in genworddoc_class.php on line 436
  • 写回答

1条回答 默认 最新

  • dtjo87679 2013-11-14 09:49
    关注

    Found to be an issue with Word and the PHP script executing too fast for Word to respond.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败