Open the word document when calling the COM component of WPS and msoffice
Source: Internet
Author: User
When you call the COM component of WPS and msoffice, you can open the Word document. I want to use WPS and msoffice to convert the office document to a pdf file. there is no problem with excel or ppt, that is, when a word file is opened, the server waits. if a word is opened in a process, you must manually close it. $ Office = open the word document when calling the COM component of WPS and ms office
I want to use WPS and ms office to convert office documents to pdf files. there is no problem with excel and ppt, that is, when the word documents are opened, the server waits, the process that opens the word is added to the process, and you need to manually close it.
$ Office = new COM ('wps. application ');
$ Wps = $ office-> Documents-> Open ("D:/APMServ5.2.6/www/htdocs/pa.doc"); // This is an issue that occurs when you execute this sentence.
WPS and ms office have been tried, and such problems may occur.
Environment: win7 + Apache
------ Solution --------------------
Add one sentence below $ office = new COM ('wps. application ');
$ Office-"Visible = 0;
Try
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.