PowerPoint ActivePresentation.Save() - No Save Dialog

C

CodeMonkey

I'm writing an Office 2007 addin, in which if a user performs an action I
wish to prompt the user to save the file locally (if it hasn't already)
before continuing the action.

I call ActivePresentation.Save(), which (for a previously unsaved
presentation) dumps the file to the application root folder without the
option to set the location/filename!!!
In other object models (Word etc...) calling the Save() method, shows the
Save dialog.

What do I need to do to cause the dialog to appear in Powerpoint ???????
 
S

Steve Rindsberg

CodeMonkey said:
I'm writing an Office 2007 addin, in which if a user performs an action I
wish to prompt the user to save the file locally (if it hasn't already)
before continuing the action.

I call ActivePresentation.Save(), which (for a previously unsaved
presentation) dumps the file to the application root folder without the
option to set the location/filename!!!

Actually, I think it saves the presentation into the current directory,
whatever that may be (ie, not necessarily the app's root folder).

Not sure about the Help entry for this in 2007 but in 2003 it says:

=====================================
Remarks
Use the SaveAs method to save a presentation that hasn't been previously saved.
To determine whether a presentation has been saved, test for a nonempty value
for the FullName or Path property. If a document with the same name as the
specified presentation already exists on disk, that document will be
overwritten. No warning message will be displayed.

To mark the presentation as saved without writing it to disk, set the Saved
property to True.
=======================================

The .Save method has never displayed a dialog box in any version of PPT.

If you want to display a dialog box:

Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog( _
Type:=msoFileDialogSaveAs)
dlgSaveAs.Show
Debug.Print dlgSaveAs.SelectedItems(1)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top