views:

89

answers:

0

First, let me describe the application, then the need. My application is an ASP.NET MVC app that has a contacts database.

One feature of my application allows a user to create Microsoft Word templates with mail-merge fields in it. Once the templates are uploaded, the requirements of the mail-merge feature are as follows:

  1. Allow the user to select a contact from the contacts database.
  2. The user should be able to pick a mail-merge letter to generate from the list of available templates.
  3. The system performs the mail-merge with the contact details, and the user gets the Word document in the browser.
  4. The user is allowed to make some edits to the Word document--maybe because some content needs to be added that is in the database..
  5. Once the user is done making edits, the user commits/submits the document back to the application so that the final edited version is attached to the contact record.

This should be really easy to the user even through a web browser. They do not want a solution where the document is downloaded to the users PC or Word is opened as a separate app, then they have to save the file locally, and upload the file manually.. The ideal case is Word is embedded in the web browser with the document to edit, and there is a button that says Submit when this is done.

Ok, so I think I've solved 85% of this problem using EDraw OfficeViewer ActiveX component. I've also tried UltraOffice, and the old dsoFramer ActiveX control.

The last 15% snag I am running into is that while these components support older versions of Microsoft Office.. down to Office 2000, the component fails when you are asking the older Word version to open a .docx (Open XML Office 2007 format) even though I've installed the compatibility upgrade. I've verified that Ms Word can open these .docx files directly, however, when embedded using ActiveX, they fail with the error: "The associated COM server does not support ActiveX Document embedding", or "Attempt to access invalid address." depending on which component I'm testing.

I need to support .docx because I'm manipulating the templates server side using the OpenXML API.

So now, I'm looking for alternatives on how to solve the requirements above. The best case is a model that isn't tied to ActiveX and works for other browsers--not just IE. If it isn't possible, I can live with ActiveX, but I really would like to support .docx.

Has anybody here tried to solve this kind of problem?