1

我有以下代码来显示目录选择器对话框

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 中的任何替代方案,请告诉我!

4

1 回答 1

3

通过使用 NotesUIWorkspace- 类的 SaveFileDialog- 方法,在 LotusScript 中有一种“标准”方法来执行此操作。

'...your sub goes around this
Dim ws as New NotesUIWorkspace
Dim varPaths as Variant
varPaths = ws.SaveFileDialog(  True  , "Choose file" , "" , lastPath )
If not isEmpty( varPaths ) then
  selectOutputFolder = varPaths(0)
End If
于 2013-05-27T09:00:13.400 回答