tags:

views:

34

answers:

1

Without getting into a large debate as to the merits of doing so, can some one provide direction as to using a VSTO Application Level AddIn (Word 2007) to oepn a MS Word Document from either a database or a web service?

Thank you


Jacob,

Are you suggesting

  1. PC/AddIn Queries Server for a Document
  2. Server returns document to PC/AddIn
  3. PC/AddIn saves document locally (as temp file)
  4. PC/AddIn uses word Open document functionality to open the file locally

Then

  1. PC/AddIn Save these file locally
  2. PC/AddIn Uploads the file back to the server

That doesn't sound quite so hard... In fact it is the type of solution that has a level of simplicity that makes writing / debugging easy.

What advantage does one have using the above methodology as oppoased to WebDAV? Apparently webDav is what alfresco uses...

Another question though, Does word not have the functionality to open documents from a stream in its API?

T

A: 

As Jacob noted, you could save the blob as a tmp file, and then open it in the normal way. This is the easiest, though if you need to write the edits back, you'll also need to think about locking.

If you need to worry about those things, WebDAV starts to look more interesting. You could open via WebDAV if you can make your server-side support this, and let Word do the rest (although the document may be read only, depending on client config and server).

Finally, if it is a docx, you could avoid the tmp file, by inserting a Flat OPC version into a new Word using InsertXML. This is a bit more complicated (since you have to make the Flat OPC XML, though there is code for this in an MSDN blog post somewhere), but if you find yourself using InsertXML for other reasons, this might be attractive.

plutext