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
Printable View
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
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.
Hi, :D
DRJ is right but there is a work-around (less flexibel..but still) :rofl:
Just execute the toolbar button:
[VBA]' CommandBars("File").Controls("Opslaan als...").Execute 'Dutch
CommandBars("File").Controls("Save As...").Execute 'English
[/VBA]
Or more nutral:
[VBA]
CommandBars.FindControl(Id:=748).Execute
[/VBA]
Enjoy! :thumb
Hi, :D
Found a better one..
If you have Office 2002/2003: (Don't know about 2000)
[VBA]Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog( _
Type:=msoFileDialogSaveAs)
dlgSaveAs.Show
End Sub
[/VBA]
:thumb
Glad to see it works for you! :thumb
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...
[vba]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[/vba]
Hi Zack, :D
True you need to alter it to have it save the presentation. ;)
Thanks
useful info .thx