Disclaimer is that I work for a company that sells one of these, but nonetheless I want to share my experiences because I have been confronted with this question so often.
Using Invantive Composition (http://www.invantive.com/products/invantive-composition) you can fill Word documents (letters, legal pleadings, contracts and other things with flexible conditions) with data from a supported database platform. Currently these are Oracle, MySQL, Teradata, DB2/UDB and SQL Server). And then fully change the contents at will manually. It is intended for non-technical users. The central webservice proxies the data requests for the backend databases. Allows nested repeating groups of data (such as: "order with order lines").
In the past, JasperReports (http://community.jaspersoft.com/project/jasperreports-library) has been used a lot to generate letters using the RTF output of JasperReports (designer tool is named iReports). It is free and works fine as long as you do not want to edit the output more than a few words and have some Java development skills. It integrates well in various websites but you need to integrate Java runtime. Just as Invantive Composition it works fine for large numbers of different reports.
As long as you can control the environment completely, you can also consider using RTF as intermediate language (not for end-users, only real developers). Save document as RTF, replace parts of the text you need to be replacable, write a webservice that accepts the parameter and dumps back the resulting RTF. Takes some time to generate more complex tables (tables are obviously something invented by the human race after the RTF specification was written This approach only works with very limited number of templates and when you have sufficient developer time available to get it up and running and stabilized.
Sometimes it is also possible to use XML (docx is actually a zip with xml in it). Using the RTF approach. This one is harder upto very hard, because for instance Word adds XML-tags anywhere in the text. You really need to write a multi-stage parser for that to do it reliably.
I think when you need just a few templates and want to save out-of-pocket costs and have sufficient time, I would go for RTF in your case.