Forum


Replies: 5   Views: 6534
Com class doesn't open word file correctly
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by arcmedia  · 19-03-2015 - 10:30

We are generating a Word File and then converting it to PDF via ``transformDocxUsingMSWord``. This works perfectly on our local environment, however fails in production. Here's what happens: 1. Word File is generated correctly 2. $docx->transformDocxUsingMSWord() is executed 3. In MSWordInterface.inc, the transformFormat() method tries to open the file via: $MSWordInstance->Documents->Open($docSource); 4. The class tries to save the document as a pdf via: $MSWordInstance->Documents[1]->SaveAs($docDestination, $code[$extension]); however $MSWordInstance->Documents[1] does not exist. 5. Exception thrown: CRITICAL: Uncaught PHP Exception com_exception: "Source: Microsoft Word
Description: The requested member of the collection does not exist." at C:\[...]\Classes\Phpdocx\Converters\MSWordInterface.inc line 62 {"exception":"[object] (com_exception(code: -2147352567): Source: Microsoft Word
Description: The requested member of the collection does not exist. at C:\\[...]\\Classes\\Phpdocx\\Converters\\MSWordInterface.inc:62)"} [] So the method to open the Word file does not return any error, however doesn't open the file as well.. The server is a Windows Server 2012R2 Standard, running Apache2.4 with Word2010 installed. I reckon that it's something about privileges of the user, however can't find any solution. Any ideas?