This is my first post here - yay! This is my function that I am calling (just passing test arguments):
The output from the function is:
Also, I'm assuming that you must have Word installed on the machine? That will be fine for my localhost, but will I also have to put Word on the server when the time comes?
Hey, thanks for your help!
- Scott
Code:
function makeDoc($name,$content){ // starting word $word = new COM("word.application") or die("Unable to instantiate Word"); echo "Loaded Word, version {$word->Version}\n"; //bring it to front $word->Visible = 1; //open an empty document $word->Documents->Add(); //do some weird stuff $word->Selection->TypeText("This is a test document. Your name is $name and you said: $content"); $word->Documents[1]->SaveAs("test.doc"); //closing word $word->Quit(); //free the object $word = null; }
Loaded Word, version 12.0
Fatal error: Call to undefined method variant::SaveAs () in C:\wamp\www\... \docgen.php on line 93
Fatal error: Call to undefined method variant::SaveAs () in C:\wamp\www\... \docgen.php on line 93
Hey, thanks for your help!
- Scott
Comment