Sub loadpic() ' ' loadpic Macro ' 宏在 2010-6-21 由 Smile Xu 创建 '
Dim picOpenDialog As FileDialog, filePath As String
On Error Resume Next '忽略错误
Set picOpenDialog = Application.FileDialog(msoFileDialogFilePicker)
With picOpenDialog .Filters.Clear '清除所有文件筛选器中的项目
.Filters.Add "JPG文件", "*.jpg", 1 '所有JPEG文件
.Filters.Add "BMP文件", "*.bmp", 2 'BMP文件
.Filters.Add "所有文件", "*.*", 3 '针对所有文件
.AllowMultiSelect = True '允许多项选择
If .Show = -1 Then
For Each vrtSelectedItem