Consulting

Results 1 to 9 of 9

Thread: Solved: Save as dialog box

  1. #1

    Solved: Save as dialog box

    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

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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.

  3. #3
    Administrator
    VP-Knowledge Base VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    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)

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    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)

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    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)

  6. #6
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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]

  7. #7
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    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)

  8. #8
    VBAX Newbie
    Joined
    May 2013
    Posts
    1
    Location
    Thanks

  9. #9
    VBAX Newbie
    Joined
    Jun 2013
    Posts
    5
    Location
    useful info .thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •