Office集成(Word)-拦截保存
我计划实施一个小型内部文档管理系统。它必须有一个 Web GUI,用于管理存储在数据库中的远程文件夹结构。这些文件夹中存储了 Word 文档(物理上作为数据库中的 blob)。每当用户单击文档链接时,就会通过浏览器下载单词二进制文件,并(希望)在用户 PC 上的 Word 中打开。
这是简单的部分;)
现在用户点击“保存”或 Ctrl-S。我想要在 Word 中编写一个功能,该功能调用自定义函数(可能在 .NET DLL 中),将保存的文件上传回服务器 (HTTP)。在我看来,困难的部分是:
- 如何拦截保存过程来调用扩展功能
- 如何将其部署到多个用户
I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC.
This is the easy part ;)
Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a custom function (maybe in a .NET DLL) that uploads the saved file back to the server (HTTP). The hard part seems to me:
- How to intercept the Save process to call the extension functionality
- How to deploy this to multiple users
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
迈克的链接到我回答的问题应该用于拦截文件保存。
File->Save
的特定按钮 idMso 是“FileSave”要将其部署到多个用户计算机,您可以
Mike's link to the question I answered should do it for intercepting the file save. The specific button idMso for
File->Save
is "FileSave"To deploy it to several users machine you can either
AFAIK,这就是 Alfresco 正在用它的 Microsoft Office 加载项(不过我自己从未测试过)。由于 Alfresco 是开源的,因此一定可以查看他们在做什么。或者直接在 Alfresco 的论坛上提问。
AFAIK, this is what Alfresco is doing with its Microsoft Office Add-ins (never tested myself though). As Alfresco is open-source, it must be possible to look at what they are doing. Or just ask your questions on Alfresco's forums.
您可以尝试覆盖功能区中的“保存”或使用您想要的行为构建您自己的功能区选项卡。覆盖“Ctrl-S”可能会更棘手。
覆盖功能区:StackOverflow 问题
有关更改标准功能区按钮的视频:Office 开发人员中心
You can try to override "save" from the ribbon or build your own ribbon tab with the behavior you want. It may be trickier overriding "Ctrl-S".
Overriding the ribbon: StackOverflow Question
Video on altering a standard ribbon button: Office Developer Center