I've done this myself.
I'm hoping you know how to get data form your database. I'm not going to go into much detail here, I don't have the time.
The trick to remember is that you have to control the output sent to the web browser form your code so it's not normal "text/html" but the msWord MIME type.
To do this you have to set the contentType property of the HttpResponse object to "application/msword"
Then you're going to also want to add a header that tells the browser what to do with it. In this case you use the .AddHeader method of the HttpResponse object to add the following header...
[Visual Basic]
Response.Addheader("content-disposition", "attachment; filename=mywordfilename.doc")
[C#]
Response.AddHeader("content-disposition", "attachment; filename=mywordfilename.doc");
I'm sure if you search Google for "content-dispotion" and "application/msword" and "mime" you'll get good hits.
Good luck.
Enter your message below
Sign in or Join us (it's free).