I need to create a word document from a word template, its something like, we need to replace the few strings (say variables) in the template with the values.
Please
Check http://www.phpbuilder.com/annotate/message.php3?id=1024286 and also the article it comments.
I made a similar trick when I needed to generate a simple excel table. When sending the right header, the client's excel didn't complain at all. Or if you can use another format directly, use it. (.docx or open document are compressed xml, so you can manipulate it more easily)