我有以下代码来显示目录选择器对话框
Function selectOutputFolder(lastPath As String) As String
Const BIF_NEWDIALOGSTYLE = &H00000040
Dim objShell As Variant
Dim objFolder As Variant
Dim objFolderItem As Variant
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Choose a directory", BIF_NEWDIALOGSTYLE, lastPath)
If Not (objFolder Is Nothing) Then
Set objFolderItem = objFolder.Self
selectOutputFolder = objFolderItem.Path
End If
End Function
我在玩它的第 4 个参数,BrowseForFolder
它只是目录遍历的限制,而不是在打开时跳入这个文件夹。
这是在 lotus 脚本代理中实现的,所以如果您知道 vba 或 lotusscript 中的任何替代方案,请告诉我!