Beyond HTML
Beyond HTML

Reputation:

Office integration (Word) - intercepting save

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:

Upvotes: 2

Views: 3400

Answers (3)

Jacob Adams
Jacob Adams

Reputation: 3994

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.

Upvotes: 1

Michael Regan
Michael Regan

Reputation: 1598

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

Upvotes: 1

Pascal Thivent
Pascal Thivent

Reputation: 570385

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.

Upvotes: 1

Related Questions