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.. |
|
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. |
|
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. |
|
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. |
|