Private Sub cmdFileDialog_Click()
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Me.FileList.RowSource = ""
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = True
.Title = "Please select one or more files"
.Filters.Clear
.Filters.Add "Access Databases", "*.ACCDB"
.Filters.Add "Access Projects", "*.ADP"
.Filters.Add "All Files", "*.*"
If .Show = True Then
'Loop through each file selected and add it to our list box.
For Each varFile In .SelectedItems
Me.FileList.AddItem varFile
Next
Else
MsgBox "You clicked Cancel in the file dialog box. Кликните и уходите....."
End If
End With
End Sub
|