Well with the new PHP4 they have built in some new functions that do this sort of thing. You can do this through COM objects. You have to be running (as near as I can tell) php4 on a windows platform to do this. I have not found many examples of this utilized (even the manual has an incouraging ??? after each funtion 🙂 ), but I did find a COM example on the Zend website
http://www.zend.com/codex.php?id=114&single=1
this should help you get started in creating a word document. Or a similar miscrosoft documents.
Hope that helps.