I am trying to write to a Word document using this code:-
<?php
// 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...");
$word->ActiveDocument->SaveAs("c:\Useless test.doc");
//closing word
$word->Quit();
//free the object
$word = null;
?>
When running this code i get this error 'Call to undefined method variant::SaveAs() '
I have tried altering the permissons for the COM setting but it has not work.
I am using PHP locally and I am logging in as a differnet user than the one I installed Word on.
I am using xampp with Windows Vista.
Please help.
Simon.