I have written in php an complete system for administration and made a template with formfields in wordxp for letters and have an access2000 database with information. The Accessdatabase is connected by odbc to the webinterface and I am getting information out of it by php-scripts.
So far the situation, now the problem.
I receive with php some information out of the access database(Name, Address and more) Now I would like to put this information in the right formfield on the Template in WordXP.
I Can start up word and show the template, but the last part putting the information out of a php-script on the formfields of the template doesn't work at the moment.
If anyone could help me with this you would make me glad. I have added the script below the lines.
Greetings from the Netherlands,
Johan Heegsma
Student
#Instantiate the Word component.
$word = new COM("word.application") or die("Unable to instantiate Word");
#Get and print its version
print "Loaded Word, version {$word->Version}
";
#Another way to get the version using com_get
$testversion = com_get($word->application,version);
print "Version using Com_get(): $testversion
";
#Make it visible in a window
$word->Visible = 1;
#Open a new document
//$word->Documents->add();
$word->Documents->Open("D:\first1.dot");
#Write something
//text is diplayed in document, but not yet in a formfield.
$word->Selection->TypeText("This is a test...");
#Now save the document
$word->Documents[1]->SaveAs("Useless test.doc");
#Comment next line if you want to see the word document,
#then close word manually
//$word->Quit();
#Comment if you want to see the word document, then close
?>