1
votes

I am developing Office Addin for MS Word 2013 using Office Javascript API and I need to change the behaviour when user click FileSave or FileSaveAs in the main menu.

Is there any way to replace the default command via Office Javascript API by execute a function with in this addin instead of default behaviour?

Or can I catch somehow BeforeSave event using Office Javascript API?

Or can I develop C# Office Addin that will replace default menu with commands that will execute a javascript function in a specified Office Addin?

Or is there any other way to achieve this?

1

1 Answers

1
votes

There is currently no way to affect how File/Save As (or Save) works using the JS API.

Affecting the Ribbon (menus) can only be done using Ribbon XML / add in commands. This was added to the Office JS for Office 2016 and is therefore not available for Office 2013. (See the requirement sets.)

Even then, the XML for Office JS does not support manipulating the built-in application Ribbon elements, unlike the full Ribbon XML available for COM add-ins.

There is no support for events in Word beyond those available in the common API (activeViewChanged and selectionChanged on the Document object).