Application.FileDialog property (Publisher)
Returns a FileDialog object that represents a single instance of a file dialog box.
Syntax
expression.FileDialog (Type)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Required | MsoFileDialogType | The type of dialog box. |
Return value
FileDialog
Remarks
The Type parameter 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.
Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Dim strFile As String
Set dlgSaveAs = Application.FileDialog( _
Type:=msoFileDialogSaveAs)
dlgSaveAs.Show
strFile = dlgSaveAs.SelectedItems(1)
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.