Page 1 of 1

error while creating word file

Posted: Thu Jan 19, 2012 8:55 am
by kkr653
i have run the following 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->Documents[1]->SaveAs("anp.doc");

//closing word
$word->Quit();

//free the object
$word = null;
?>


BUT IT SHOWS THE FOLLOWING ERROR
Loaded Word, version 12.0
Fatal error: Cannot pass parameter 1 by reference in F:\wamp\www\dddddddddd\worddd.php on line 13

Re: error while creating word file

Posted: Tue Jan 24, 2012 4:17 am
by social_experiment