There is an Open XML Library in PHP, that permits you build Office Document from PHP code. You can see it in http://oxml.110mb.com/