It may be going back a few versions of Word (Office 2000, I think) but I was certainly able to do a str_replace on a Word doc in the past. I just had a few tags in the document - such as ##AUTHOR_NAME##. I could then read the tagged document into memory, str_replace the tags with actual values, and save under a new name.
So long as the replacement text was around the same size as the tag, and didn't change the number of lines in the document it all worked fine.
I've also been reduced to doing the same thing with postscript files.