Save as In PowerPoint VBA

1.8k Views Asked by At

Hello I have been looking into this and have found some things but either I am an idiot or everything I have found has left out a few details.

I am making an add-in that completely changes what is in the presentation and as such I want to make sure the user doesn't accidentally destroy all of their work by forcing a new save before the add-in runs. I am trying to get the "Save as" window to display so that the user can browse for a save location and put in a filename.

Up to this point I have found:

Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)

dlgSaveAs.Show

This shows the "Save as" window but does not actually seem to save anything.

I have also found:

ActivePresentation.SaveAs

This seems like it will work but I don't know how to get the information from the "Save as" window to this line.

Does anyone know how to resolve this? Or have a different/better solution?

Update: looking back at this it seems my code does save after a fashion, it even saves where I tell it to. but always with the name FileDialog(msoFileDialogSaveAs).

code as follows:

 Dim dlgSaveAs As FileDialog
 Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)

 dlgSaveAs.Show

 ActivePresentation.SaveAs (dlgSaveAs)
0

There are 0 best solutions below