Office集成(Word)-拦截保存

发布于 2024-08-05 03:13:48 字数 329 浏览 0 评论 0原文

我计划实施一个小型内部文档管理系统。它必须有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笨死的猪 2024-08-12 03:13:48

迈克的链接我回答的问题应该用于拦截文件保存。 File->Save 的特定按钮 idMso 是“FileSave”

要将其部署到多个用户计算机,您可以

  1. 创建一个安装项目,该项目将创建一个可以在所有用户计算机上运行的 msi,
  2. 如果这是一个 Intranet 场景,您可以将程序集保留在网络位置上,只需将必要的注册表设置添加到所有用户计算机即可。这个 文章应描述您需要包含的设置。您只需更改路径设置以指向网络位置。

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

  1. Create a setup project that will create an msi that you can run on all the users machines
  2. if it's an intranet scenario, you can keep the assemblies on a network location and just add the neceassary registry settings to all the users machines. This article should describe the settings that you need to include. You would just need to change the path setting to point to the network location.
平定天下 2024-08-12 03:13:48

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.

别想她 2024-08-12 03:13:48

您可以尝试覆盖功能区中的“保存”或使用您想要的行为构建您自己的功能区选项卡。覆盖“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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文