从数据库或WebService打开的Word文档 [英] Open WORD Document from Database OR WebService

查看:535
本文介绍了从数据库或WebService打开的Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有进入大辩论,这样做,能有人提供方向,以使用VSTO应用程序级外接程序(Word 2007中)从数据库或Web服务oepn MS Word文档的优劣?

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?

感谢您

雅各

您提示


  1. PC /外接程序查询服务器为一个文件

  2. Server返回文档PC /外接程序

  3. PC /外接程序保存在本地文件(如临时文件)

  4. PC /外接程序使用Word中打开文档功能打开本地文件

  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

然后


  1. PC /外接程序在本地保存这些文件

  2. PC /外接程序进行上传文件到服务器

这听起来并不很好难......其实,这是一个具有简单的水平,使写入/调试方便的解决方案的类型。

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.

做一件有哪些优势使用上述方法,因为oppoased WebDAV的?显然,WebDAV是什么户外使用...

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

不过还有一个问题,难道没有这个词有它的API中打开从流文件的功能?

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

T

推荐答案

至于雅各布指出,可以为您节省团块为tmp文件,并然后以正常方式打开它。这是最简单的,但如果你需要的编辑写回,你还需要考虑锁定。

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.

如果你需要担心这些事情,WebDAV的开始显得更有趣。你可以通过WebDAV打开,如果你可以让你的服务器端支持这一点,并让Word中完成剩下的(尽管该文件可能是只读的,这取决于客户端配置和服务器)。

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).

最后,如果它是一个的docx,你可以避开tmp文件,通过插入一个扁平的OPC版本为使用InsertXML一个新的Word。这是一个比较复杂(因为你必须使扁平OPC XML,虽然有在MSDN博客文章的这段代码的地方),但如果你发现自己使用InsertXML出于其他原因,这可能是有吸引力的。

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.

这篇关于从数据库或WebService打开的Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆