下面是我正在使用的代码片段,但是在执行它时我得到了下面的错误并且似乎无法弄清楚,我使用的是 PHP 5.3.27,它在我正在升级的 PHP 4 中一切正常.
$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;
在第 436 行,这似乎引发了错误。
抛出错误:
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