如何使用com对象创建功率点文件MS word文件。 请举一些例子。我尝试了几件事。但我在我的系统中找不到该文件
示例代码如下所示
$word = new COM("word.application") or die ("couldnt create an instance of word");
echo "loaded , word version{$word->version}";
$word->visible = 1;
$word->Documents->Add();
$word->Selection->TypeText("this is some sample text in the document");
$word->Documents[1]->SaveAs("sampleword.doc");
$word->Quit();
$word->Release();
$word = null;
答案 0 :(得分:0)
尝试设置完整路径
$word->Documents[1]->SaveAs("C:\\Users\\UserNameHere\\MyDocuments\\sampleword.doc");