PDA

View Full Version : Solved: Save as dialog box



SherryO
04-26-2005, 05:17 AM
How do you get the save as dialog box to appear. Killian provided me with a macro for file merge and I want to prompt the user to Save As and give a name. I know this is 101, but I don't know what I'm doing. Any help would be appreciated. Thanks

Jacob Hilderbrand
04-26-2005, 08:27 AM
The object model for PowerPoint is not very good. What you can do is use an InputBox to get the file name, then use ActivePresentation.SaveAs to save the file as needed.

MOS MASTER
04-26-2005, 01:55 PM
Hi, :D

DRJ is right but there is a work-around (less flexibel..but still) :rofl:

Just execute the toolbar button:
' CommandBars("File").Controls("Opslaan als...").Execute 'Dutch
CommandBars("File").Controls("Save As...").Execute 'English

Or more nutral:

CommandBars.FindControl(Id:=748).Execute


Enjoy! :thumb

MOS MASTER
04-26-2005, 02:35 PM
Hi, :D

Found a better one..

If you have Office 2002/2003: (Don't know about 2000)
Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog( _
Type:=msoFileDialogSaveAs)
dlgSaveAs.Show
End Sub


:thumb

MOS MASTER
04-27-2005, 10:48 AM
Glad to see it works for you! :thumb

Zack Barresse
04-27-2005, 11:15 AM
Yes, use the second method by MOS Master. This is common in under-developed VBA Object Models and is the same with Publisher. There's no direct route as you use in Word and Excel. The FileDialog is a class of it's own, and not a native (accessible) feature - yet.

I would add...

Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog, strFile As String
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
dlgSaveAs.Show
On Error Resume Next
strFile = dlgSaveAs.SelectedItems(1)
If Err Then MsgBox "Cancel was pressed!": Exit Sub
ActivePresentation.SaveAs strFile
MsgBox "You saved the file to:" & vbNewLine & strFile
End Sub

MOS MASTER
04-27-2005, 11:36 AM
Hi Zack, :D

True you need to alter it to have it save the presentation. ;)

tefany
05-05-2013, 05:45 AM
Thanks

xmlld
06-18-2013, 06:52 PM
useful info .thx