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.

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

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题