Search code examples
vb.netvstopowerpointadd-in

How to Differentiate SaveAs call and Save call in PowerPoint events?


I'm writting AddIn for PowerPoint 2010. I'm using two functions of PowerPoint.

Application_PresentationBeforeSave(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation, ByRef Cancel As Boolean)

Application_PresentationSave(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation)

When I perform Save operation (Ctrl+S) or SaveAs (File -> SaveAs) on powerpoint it executes Application_PresentationBeforeSave() method.

But I need to differentiate these two calls (Ctril+S & SaveAs) and accordingly perform some task. So how can I differentiate these two calls in BeforeSave method ??

As for Word, in Application_DocumentBeforeSave(ByVal Doc As Microsoft.Office.Interop.Word.Document, ByRef SaveAsUI As Boolean, ByRef Cancel As Boolean) there is SaveAsUI flag which differentiate whether this method has been called by SaveAs or Ctrl+S action.

So is there any flag/property which differtiate same things in PowerPoint ??


Solution

  • Thanks Eugene for showing me a way. My problem got resolve. I tried your suggestion.

    Here is the description of my solution. I have added function call in Ribbon.xml

    In MySaveAs() function I set one glbal variable. And used it in BeforeSave mthod.