Expose "save" event in Office.js across platforms

Expose "save" event in Office.js across platforms
21

Upvotes

Upvote

 Aug 26 2022
6 Comments (6 New)
New

Office.js should expose save events that allow add-ins to take an action before the document actually gets saved.

 

This is especially an issue when using such platforms like Word in the browser, which auto saves very frequently.

 

For example, we want to ensure a document gets saved encrypted at all times, but still allows the end user to work with the unencrypted content of a document. Currently, as far as I know, there is no way for us to take any sort of action before a document gets saved (especially to the cloud). This is a major issue when working with sensitive data that should never be saved unencrypted to cloud storage.

Comments
Microsoft

@cody-lettau Thanks for the posting. Can you also describe how do you want the event fired when it is auto-save?

 

Thanks.

Microsoft

@cody-lettau Thanks for the posting. Can you also describe how do you want the event fired when it is auto-save?

 

Thanks.

Brass Contributor

Hi @Yun_Wang - I think the best approach would be that an event is fired prior to the actual save occurring so that an add-in can do any pre-processing desired to the content and file data prior to it being saved to the server.

 

In our use case, we never want the unencrypted document to be saved to the server. This is for obvious reasons if the goal is data security/privacy. So in this case, we would want to be able to be notified when a save is about to occur, encrypt the document, and have that encrypted version saved to the server.

Copper Contributor

Please expose a BeforeSave event, so we can register and handle changes before the actual save is done. 

Copper Contributor

The lack of a BeforeSave Event causes all sorts of problems for our Excel Addin. Please add!!

Copper Contributor

We need to include some state information for our Add-In in the workbook, whenever the workbook is saved. It doesn't make sense to store this state separately from the workbook because that would likely get out of sync. For example, we wouldn't be able to track if the workbook got copied or deleted. It might also be useful to know if the workbook was being autosaved, or explicitly saved by the user (outside of OneDrive, or with AutoSave turned off).