Library code snippets

Accessing COM objects from PHP

PHP4 no longer uses the com_load function anymore. Instead, you can use the COM object:

<?
$word=new COM("word.application") or die("Cannot start word for you");
print "Loaded word version ($word->Version)\n";
$word->visible =1;
$word->Documents->Add();
$word->Selection->Typetext("Dit is een test");
$word->Documents[1]->SaveAs("burb ofzo.doc");
$word->Quit();
?>

If you are still using PHP 3, then you can use the com_load function.

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of Accessing COM objects from PHP.

Leave a comment

Sign in or Join us (it's free).

 altphpfaq
AddThis

Related podcasts

  • EarthClassMail.com - Moving from LAMP to .NET 3.5

    Scott chats with Matt Davis, architect at EarthClassMail.com, about their move from a LAMP stack (Linux/Apache/mysql/PHP) to .NET 3.5. What's working, what's not, and what kinds of issues are they running into as their architect their solution.

Events coming up

  • Jul 18

    WordCamp UK 2009

    Cardiff, United Kingdom

    This is the second WordCamp UK - an informal annual gathering of WordPress publishers, designers and developers based in the United Kingdom.

Want to stay in touch with what's going on? Follow us on twitter!