Export (0) Print
Expand All

Application.FileDialog Property

Office 2007
Returns a FileDialog object that represents a single instance of a file dialog box.

Syntax

expression.FileDialog(Type)

expression   A variable that represents a Application object.

Parameters

NameRequired/OptionalData TypeDescription
TypeRequiredMsoFileDialogType The type of dialog box.

Return Value
FileDialog

Remarks

The Type parmater can be one of the MsoFileDialogType constants declared in the Microsoft Office type library.

Example

This example displays the Save As dialog box and stores the file name specified by the user.

Visual Basic for Applications
Sub ShowSaveAsDialog()
    Dim dlgSaveAs As FileDialog
    Dim strFile As String

    Set dlgSaveAs = Application.FileDialog( _
        Type:=msoFileDialogSaveAs)
    dlgSaveAs.Show
    strFile = dlgSaveAs.SelectedItems(1)
End Sub



Community Additions

ADD
Show:
© 2014 Microsoft