当前位置:Gxlcms > PHP教程 > php调用COM

php调用COM

时间:2021-07-01 10:21:17 帮助过:5人阅读

这里是一个PHP用COM操作windows下word的过程

PHP代码

Version}
"; // set the visibility of the application to 0 (false) // to open the application in the forefront, use 1 (true) $word->Visible = 0; // create a new document in Word $word->Documents->Add(); // add text to the new document $word->Selection->TypeText("Testing 1-2-3..."); //save the document in the Windows temp directory $word->Documents[1]->SaveAs("/Windows/temp/comtest.doc"); // close the connection to the COM component $word->Quit(); // print another message to the screen echo "Check for the file..."; ?>

人气教程排行