FileDialog Property

Returns a FileDialog object (Microsoft Office 2003 Visual Basic Reference) that represents a single instance of a file dialog box.

expression.FileDialog(Type)

*expression   * Required. An expression that returns an Application object.

MsoFileDialogType

MsoFileDialogType can be one of these MsoFileDialogType constants.
msoFileDialogFilePicker
msoFileDialogFolderPicker
msoFileDialogOpen
msoFileDialogSaveAs

Example

This example displays the Save As dialog box.

Sub ShowSaveAsDialog()
    Dim dlgSaveAs As FileDialog
    Set dlgSaveAs = Application.FileDialog( _
        Type:=msoFileDialogSaveAs)
    dlgSaveAs.Show
End Sub

This example displays the Open dialog box and allows a user to select multiple files to open.

Sub ShowFileDialog()
    Dim dlgOpen As FileDialog
    Set dlgOpen = Application.FileDialog( _
        Type:=msoFileDialogOpen)
    With dlgOpen
        .AllowMultiSelect = True
        .Show
    End With
End Sub

Applies to | Application Object