关于php中的Com对象

How can I Create a power point file MS word file using com object. Please give some example for that.I tried with few things .But i Can't find the file in my system

The sample code is given below

$word = new COM("word.application") or die ("couldnt create an instance of word"); 
echo "loaded , word version{$word->version}"; 

$word->visible = 1; 

$word->Documents->Add(); 

$word->Selection->TypeText("this is some sample text in the document"); 

$word->Documents[1]->SaveAs("sampleword.doc"); 

$word->Quit(); 

$word->Release(); 
$word = null; 

Try to set full path

$word->Documents[1]->SaveAs("C:\\Users\\UserNameHere\\MyDocuments\\sampleword.doc");