Does it have to be a real template? I am asking because that implies some sort of "mail merge" type process, which can't/shouldn't be done on the server.
If you can use a regular Word document,
the Open XML [
^] will generate a class for creating the doc in which you can replace the 'template' fields with the real data.
In the generated code, it will look something like this:
Run run1 = new Run();
Text text1 = new Text();
text1.Text = "This is a fake template, and here is the DATA1";
run1.Append(text1);
paragraph1.Append(run1);
but you'd change it to this:
Run run1 = new Run();
Text text1 = new Text();
text1.Text = "This is a fake template, and here is the "+DATA1;
run1.Append(text1);
paragraph1.Append(run1);
And replace all your variables at runtime.