/ / starting word $word = new COM( "word.application") or die("Unable to instanciate Word"); print "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("Useless test.doc"); / /closing word $word - Quit(); / /free the object $word - Release(); $word = null;
?php / / démarrage de Word $word = new COM( "word.application") or die("Unable to instanciate Word"); print "Word lancé, version {$word - Version}\n"; / /amener Word devant $word - Visible = 1; / /cree un document vide $word - Documents - Add(); / /Quelques commandes $word - Selection - TypeText("Ceci est un test.. ."); $word - Documents[1] - SaveAs("test.doc"); / /Fermeture de word $word - Quit(); / /Libération des ressources $word - Release(); $word = null;?