Function GetFolder() As String
Dim dlgOpen As FileDialog
Dim i As Long, j As Long
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True
.Show
End With
i = dlgOpen.SelectedItems.Count
If i > 0 Then
GetFolder = ""
For j = 1 To i - 1
GetFolder = GetFolder & dlgOpen.SelectedItems(j) & ";"
Next
j = i
GetFolder = GetFolder & dlgOpen.SelectedItems(j)
Else
GetFolder = CurrentProject.Path '词句有错误,得到的是该程序所在的文件夹。如何得到打开的文件夹?
End If
Set dlgOpen = Nothing
End Function
(算法函数_API_系统-相关文章技巧链接): Access 如何得到打开文件夹的路径(已解决)