views:

20

answers:

1

I am trying to have letter templates (word documents) that are stored in sql server VarBinary(max) to be accessed via a web application where they will be edited and saved back to sql server by directors of our company. Then various managers will be able to select an existing template (word document), make any additions, and mail merge with a list of customers to print or save the letters.

I am looking to open up word within a web page much like you would an email in outlook, edit it with spell check and the like, and then save it back in sql server. I am able to get word to open from a file but it is outside of the web application in a separate word document. I am storing the word document in sql server but am unable to open it in word without having to save it to a disk (why should you have to go to a disk for viewing or editing?). I am able to programmatically mail merge but that is in a separate word application.

I am finding bits and pieces on the web but nothing that will pull things together such as embedding word but in a windows app not a web app. Mail merge from a file not from a database, converting a byte array to word in a directory but not on a web page.

Has anyone done anything like this? Any help would be greatly appreciated.

A: 

You cannot open a word document directly via a web page, edit it, and save directly to the web site. You can link to a page that returns a word document, but as you've realized, this merely causes word on the user's computer to save the document to a temporary location and open it up for editing.

The solution here is to either:

  • Convert the templates to some plain text or markup that can be easily edited on a web page and build in the mail merge capability on the back end or
  • Allow the user to download the document, edit, merge, etc..., and then provide an upload function for the user to send the data back to the server.
Chris