After searching for a long time, I finally found it! Hahaha...
//I heard that php4 also supports Java/EJB.
// this script is come from zend. : )
$word = new COM("word.application") or die("Unable to instanciate Word
");
print "Loaded Word, version {$word->Version}n";
$word->Visible = 1;
$word->Documents->Add();
$word->Selection->TypeText("This is a test... ");
$word->Documents[1]->SaveAs("Useless test.doc");
$word->Quit();
?>
Note : First use phpinfo() to see if your machine has COM support turned on.