0

My first attempt to work with MS Word application failed. The process WINWORD.EXE *32 appears in taskmanager, Apache and WINWORD dont consume any processor time, but the explorer (Firefox) remains in waiting state.

$ap=null;
try{
    // com_load_typelib('Word.Application'); // it didn't help
    $ap=new COM("Word.application");
    // $ap->Visible=false;
} catch (Exception $e){
    print "<div>$e</div>";
}
if(!$ap) print "<div>Word.application cannot be open</div>";
if($ap) $ap->quit();

My OS = Windows 7 Ultimate x64
both Apache 2.4 with PHP 5.6.13 and Office 2010 are x86
php_com_dotnet.dll loaded.
Any idea?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Hink
  • 1,054
  • 1
  • 15
  • 31
  • If I tried to run my code from commandline: php.exe my_code.php, it worked, OK appeared immediately. If I stopped the service and ran the httpd from command-line, then webserver works fine too. I configured the service under my account, but it didnt help :( – Hink Oct 16 '15 at 11:48
  • 1
    Have you tried the solutions from http://stackoverflow.com/questions/1006923/automating-office-via-windows-service-on-server-2008 ? – NineBerry Oct 08 '16 at 20:13
  • Yes!! It Works!! Now I can create word documents on server – Hink Oct 11 '16 at 21:11

0 Answers0