differentiating between Save & SaveAs in powerpoint application

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

differentiating between Save & SaveAs in powerpoint application
 
Lakshman Kumar


Guest


Hi,

I have created a sample Add-in for Word/Excel/Powerpoint/Outlook (supporting from 2003-2019 office). But I want to intercept the Save & SaveAs of documents and I was able to do it for word & excel as BeforeSave() function of corresponding applications has the SaveAsUI as "ADXHostBeforeSaveEventArgs" argument. But in case of powerpoint there is no option for SaveAsUI as it is getting different type i.e. ADXHostBeforeActionEventArgs which doesn't has this option.

So is there any way to differentiate between save & saveAs in PresentationBeforeSave function of powerpoint?

Thanks in advance..
Posted 06 Mar, 2019 04:44:42 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Lakshman,

But in case of powerpoint there is no option for SaveAsUI as it is getting different type i.e. ADXHostBeforeActionEventArgs which doesn't has this option.


This is because the PowerPoint's DocumentBeforeClose event does not have the SaveAsUI parameter:
https://docs.microsoft.com/en-us/office/vba/api/word.application.documentbeforeclose

So is there any way to differentiate between save & saveAs in PresentationBeforeSave function of powerpoint?


I would suggest using the ADXRibbonCommand to handle clicking on the "Save As..." button located on the Backstage File tab. You will know what action the user has performed and can execute another code in the PresentationBeforeSave event handler.
Posted 06 Mar, 2019 07:33:11 Top
Lakshman Kumar


Guest


Hi,

Thanks for the reply. I tried that but for 2010 powerpoint IdMso="FaveSaveAs" is capturing the event and able to block. But when trying Office 365 Pro plus with IdMso="TabSave", event not been captured (I debugged).

Could you please suggest as I want this to work from powerpoint 2010-2019.

Thanks.
Posted 06 Mar, 2019 21:05:43 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Lakshman,

Oh, you are right, my solution will not work for the Save As backstage tab in the most recent Power Point versions. Sorry, I cannot suggest any other solution at the moment.
Posted 07 Mar, 2019 05:02:31 Top