You will not succeed in producing a robust solution using MSOffice OLE interfaces.
They're not suitable for use in web applications - either via PHP, or anything else.
One false move, and it opens up an invisible dialogue box waiting for nonexistent user input, hangs the web server, and then locks everything up by gradually consuming all memory.
You will not succeed in producing a robust solution. Use one of the many commercial MSWord document generation libraries if you feel the absolute need to do so.
Mark