Zend - The PHP Company




External

Add Code


COM Example  

Type: code fragment
Added by: herouth
Entered: 05/04/2000
Last modified: 08/12/1999
Rating: **** (17 votes)
Views: 12333
Creates a document using Word on the server, puts text in it and saves it. All this is done using the COM feature.


<?
$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();
?>


Usage Example




Rate This Script





Search



This Category All Categories