Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6070 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

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 by Guest

This topic is 6070 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.