0

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; 
j0k
  • 22,600
  • 28
  • 79
  • 90
FlexiDev
  • 1
  • 2

1 Answers1

0

Try to set full path

$word->Documents[1]->SaveAs("C:\\Users\\UserNameHere\\MyDocuments\\sampleword.doc"); 
Sergey
  • 5,208
  • 25
  • 36