我使用下面的代码在 PhP 中为 Microsoft word 设置了一个名为“Text1”的表单字段,但是在该行出现错误,如下图所示,这是什么问题$word->Documents->Open('C:/Doc1.doc');
? Cannot pass parameter 1 by reference
<?php
com_load_typelib('Word.Application');
$word = new COM("word.application");
$word->Documents->Open('C:/Doc1.doc');
$word->Visible = 1;
$word->ActiveDocument->FormFields("Text1")->Result = "something";
$word->ActiveDocument->Close(false);
$word->Quit();
unset($word);
?>