I am trying to use PHP to control Word via COM.
I keep getting the following error when I try to use the COM.
I have now simplified my code so that a simple test should work and am using
When I first ran the code I got a permissions error and followed advice found on here to add IUSR to the DCOM permissions using DCOMCNFG.EXE.
Any clues on this error and where to go?
I keep getting the following error when I try to use the COM.
Code:
Warning: Invoke() failed: Exception occurred. Source: Microsoft Word Description: Word could not fire the event. in c:\inetpub\[URL unfurl="true"]wwwroot\php\phpword1.php[/URL] on line 5
I have now simplified my code so that a simple test should work and am using
Code:
<?php
$word = new COM("word.application") or die("Unable to instantiate Word");
$output = "C:\\test.doc"; //enter an explicit path to test.doc
$word->Documents->Open($output);
$word->Quit();
$word->Release(); //free Word
$word = null;
?>
When I first ran the code I got a permissions error and followed advice found on here to add IUSR to the DCOM permissions using DCOMCNFG.EXE.
Any clues on this error and where to go?