Private Sub cmdGetFile_Click()
Dim fd As FileDialog
Dim ffs As FileDialogFilters
Dim vItem
On Error GoTo Problem
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
Set ffs = .Filters
With ffs
.clear
.add "Pictures", "*.jpg"
End With
.AllowMultiSelect = True
If .show = False Then Exit Sub
For Each vItem In .SelectedItems
Debug.Print vItem
Next vItem
End With
Exit Sub
Problem:
MsgBox "That was not a valid picture"
End Sub
|