Create a word document

Create a word document, this again I believe depends on the version of Word you have installed

$word = new COM(“word.application”) or die (“couldnt create an instance of word”);
echo “loaded , word version{$word->version}”;
//bring word to the front
$word->visible = 1;
//open a word document
//add some text to the document
$word->Selection->TypeText(“this is some sample text in the document”);
//save the document as sampleword.doc
//close word
//free object resources
$word = null;

Previous articleIf Else statement
Next articleRandom link


Please enter your comment!
Please enter your name here