How to start browsing at an existing folder location



Dear reader,


For browsing to a folder location I use the following code:



Public Function BrowseFolder(szDialogTitle As String) As String

Dim x As Long, bi As BROWSEINFO, dwIList As Long

Dim szPath As String, wPos As Integer



With bi

.hOwner = hWndAccessApp

.lpszTitle = szDialogTitle

.ulFlags = BIF_RETURNONLYFSDIRS

End With



dwIList = SHBrowseForFolder(bi)

szPath = Space$(512)



x = SHGetPathFromIDList(ByVal dwIList, ByVal szPath)



If x Then

wPos = InStr(szPath, Chr(0))

BrowseFolder = Left$(szPath, wPos - 1) & "\"

Else

BrowseFolder = ""

End If

End Function



With this code I always start on the root of the tree.

Is there a possibility to use the function so you start not on the root but
on an existing folder location in the tree?



Thanks for any help.

Kind regards,

Simon


.



Relevant Pages


Loading