catch pre-SaveAs in Office 2013/2016

Add-in Express™ Support Service
That's what is more important than anything else

catch pre-SaveAs in Office 2013/2016
catching ribbon/button no longer works 
aweber




Posts: 83
Joined: 2013-11-21
We have been catching FileSaveAs via the ADX Ribbon events in 2007 and 2010. We perform some pre-checks on the current document/presentation/workbook. Depending on the current file, we launch a messagebox to determine if the user wants to run some of our code or proceed with the default SaveAs functionality.

Testing in Office 2016 (we skipped 2013, but it may be the same), we still see a trigger on a new document for pre-save (ShowUI = True), but our SaveAs is never called. A quick search of the forums seems to talk about SaveAs having changed to a backstage tab - and that visually makes sense.

So the question is how do we now catch the SaveAs "button" in the new location? (Is the "File" ribbon now its own BackstageTab?)

Our catch of "F12" still works great and runs our functionality. Basically we'd want to ask the user if they want to use the add-in code, if so, run our forms, etc., then basically cancel the default SaveAs.

Our current code is partially this:
            // 
            // adxRCmdSaveAs
            // 
            this.adxRCmdSaveAs.Id = "adxRibbonCommand_e63b1087bba548a297511080a440609b";
            this.adxRCmdSaveAs.IdMso = "FileSaveAs";
            this.adxRCmdSaveAs.Ribbons = ((AddinExpress.MSO.ADXRibbons)(((AddinExpress.MSO.ADXRibbons.msrExcelWorkbook | AddinExpress.MSO.ADXRibbons.msrWordDocument)
            | AddinExpress.MSO.ADXRibbons.msrPowerPointPresentation)));
            this.adxRCmdSaveAs.OnAction += new AddinExpress.MSO.ADXRibbonCommand_EventHandler(this.adxRCmdSaveAs_OnAction);


Thanks for pointing us in the right direction to hook the same events in Office 2013+

-AJ
Posted 24 May, 2018 11:08:37 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello AJ,

Have a look at https://blogs.msmvps.com/wordmeister/2012/10/01/backstage-wordvba/. I can't call their suggestion a solution, though.


Andrei Smolin
Add-in Express Team Leader
Posted 25 May, 2018 03:54:24 Top