Share via


Application.FileDialog Property

Publisher Developer Reference

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

Name Required/Optional Data Type Description
Type Required MsoFileDialogType 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.<strong>FileDialog</strong>( _
    Type:=msoFileDialogSaveAs)
dlgSaveAs.Show
strFile = dlgSaveAs.SelectedItems(1)

End Sub

See Also