php手册的例子// starting word $word = new COM("word.application") or die("Unable to instanciate Word"); print "Loaded Word, version {$word->Version}\n";//bring it to front $word->Visible = 1;//open an empty document $word->Documents->Add();//do some weird stuff $word->Selection->TypeText("This is a test..."); $word->Documents[1]->SaveAs("Useless test.doc");//closing word $word->Quit();//free the object $word->Release(); $word = null;
看看这篇文章,也许对你有帮助,理解这个问题!谢谢! http://www.pconline.com.cn/pcedu/empolder/wz/jsp/10112/24589_1.html
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";//bring it to front
$word->Visible = 1;//open an empty document
$word->Documents->Add();//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");//closing word
$word->Quit();//free the object
$word->Release();
$word = null;