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
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,
DRJ is right but there is a work-around (less flexibel..but still)
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!
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)
Hi,
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]
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)
Glad to see it works for you!
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)
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]
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
Hi Zack,
True you need to alter it to have it save the presentation.
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)
Thanks
useful info .thx