Office integration (Word) - intercepting save

自闭症网瘾萝莉.ら 提交于 2019-12-12 20:02:16

问题


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

回答1:


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.



回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/1415316/office-integration-word-intercepting-save

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!