April 3, 200817 yr I am trying to create new word document using Filemaker PHP - API. My Code is as follows: <?php set_time_limit(0); try { ini_set("com.allow_dcom","true"); $word = new COM("word.application") or die ("couldnt create an instance of word"); print "loaded , word version{$word->version}"; //bring word to the front $word->visible = 1; //open a word document $word->Documents->Add(); //add some text to the document $word->Selection->TypeText("this is some sample text in the document"); ///$word->Selection->InlineShapes->AddPicture(".imageschart.png"); //save the document as sampleword.doc $word->Documents[1]->SaveAs("c:sampleword.doc"); //close word $word->Quit(); //free object resources $word->Release(); $word = null; echo "done."; } catch(com_exception $x) { echo $x; } ?> I am getting following error: exception 'com_exception' with message 'Failed to create COM object `word.application': Server execution failed ' in C:InetpubwwwrootNRCuploadReportDemoLast.php:7 Stack trace: #0 C:InetpubwwwrootNRCuploadReportDemoLast.php(7) com->com('word.applicatio...') #1 {main} Please guide to run this code. Edited April 3, 200817 yr by Guest
Create an account or sign in to comment