|
Dim fd As Variant
Dim filename As String
Set fd = Application.FileDialog(2)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
filename = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
If filename = "" Then Exit Sub
ACCESS帮助文件中有
.Filters.Clear
.Filters.Add "Images", "*.gif; *.jpg; *.jpeg", 1
说是用这个作筛选条件,但复制代码过后,实际运行时却出错,提示没有这些方法,
还有开头的 Dim fd As Variant 在ACCESS帮助文件中是Dim fd As FileDialog,
运行时出错,说是定义出错,没有些类型,改成 Variant 类型就可以了,请高手指点一下.
我使用上面的语句打开文件对话框,但怎样使它在打开时筛选指定类型的文件呢
[ 本帖最后由 zhichaochen 于 2008-3-29 19:51 编辑 ] |
|