1

I've got the following code to display a directory chooser dialog

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

I was playing around with the 4th parameter of BrowseForFolder which is only a limit for the directory traversal and not to jump into this folder on open.

This is implemented into a lotus script agent, so if you know any alternative in vba or lotusscript, let me know!

sascha
  • 4,671
  • 3
  • 36
  • 54

1 Answers1

3

There is a "Standard" way to do this in LotusScript by using the SaveFileDialog- Method of the NotesUIWorkspace- Class.

'...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
Tode
  • 11,795
  • 18
  • 34