none
PowerPoint PresentationBeforeSave method RRS feed

  • Question

  • Hi all,

    my com add-in replaces PowerPoint PresentationBeforeSave method.

    I want to analyze save location before user saves the file.

    I use following code:

    Office::FileDialogPtr fileDialog = spApp->GetFileDialog( Office::msoFileDialogSaveAs );

    disp = fileDialog->Show();

    if( disp != 0 )
    {

               //analyzing save location

               fileDialog->Execute();

    }

    *CancelDefault = TRUE;

    The problem that fileDialog->Execute() call does not save the file.

    I know that I can use SaveAs method of Presentation object but what the problem in my code?

    The same code works in MSWord and MSExcel.

                                      Thanks in advance, Vitaly

     

     

     

    Thursday, December 8, 2011 2:27 PM

Answers

  • Exactly.
    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader
    • Marked as answer by vitalyar Thursday, December 15, 2011 1:52 PM
    Thursday, December 15, 2011 10:45 AM

All replies

  • Hello,

    As far as I know, calling Save in BeforePresentationSave causes a crash. It was recommended to start a timer and cancel the event; then, in the Timer event you call Save() - note that this invokes BeforePresentationSave oncу again and you'll need to have a flag. 

    As to your issue, it seems you see another variation of the issue above. I suppose the timer-based solution will work in your case, too.

    About Word and Excel. They don't generate BeforeSave once again if you call Save in the BeforeSave event handler.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader
    Thursday, December 8, 2011 3:25 PM
  • Thank you for your reply.

    I have a question about Timer.

    I write add-in using C++. Are you mean I have to use Windows Timer API - SetTimer(...)?

     

    Thursday, December 15, 2011 8:23 AM
  • Exactly.
    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader
    • Marked as answer by vitalyar Thursday, December 15, 2011 1:52 PM
    Thursday, December 15, 2011 10:45 AM