Open WORD Document from Database OR WebService
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
- PC/AddIn Queries Server for a Document
- Server returns document to PC/AddIn
- PC/AddIn saves document locally (as temp file)
- PC/AddIn uses word Open document functionality to open the file locally
Then
- PC/AddIn Save these file locally
- PC/AddIn Uploads the file back to the server
That does开发者_运维问答n'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
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.
精彩评论