FileDialog Property

Microsoft Publisher Visual Basic

object which represents a single instance of a file dialog box.

expression.FileDialog(Type)

expression    Required. An expression that returns one of the objects in the Applies To list.

Type   Required MsoFileDialogType. The type of dialog.

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

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