Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BrowseForFolder question

Status
Not open for further replies.

celia1

MIS
Nov 25, 2002
20
FR
I use BrowseForFolder to have a list of folders. It's OK.
Now i want only the list of folders but i don't want to see their subfolders. How to do ?
 
not my work, sorry prob PHV's

Function PickFolder(strStartDir)
Dim SA, F
Set SA = CreateObject("Shell.Application")
Set F = SA.BrowseForFolder(0, "Choose a folder", 0, strStartDir)
If (Not F Is Nothing) Then
PickFolder = F.Items.Item.path
End If
Set F = Nothing
Set SA = Nothing
End Function
 
Thanks for your script but it doesn't response exactly to my problem

I have :
c:\FolderA
c:\FolderA\FA
c:\FolderA\FA\bin
c:\FolderA\FA\conf
c:\FolderA\FB
c:\FolderA\FC

I want that BrowseForFolder list only
c:\FolderA
c:\FolderA\FA
c:\FolderA\FB
c:\FolderA\FC

I don't want the subfolders (bin and conf)

I do :
Set F = SA.BrowseForFolder(0, "Choose a folder", &H0200, "C:\FolderA")

 
i take it you output in the post if from reading of your vairable F? in which case could you count the number of \ in the string passed ot the BrowseForFOlder method, + 1 to it then only act on the list pasted back if the string contains org + 1 \'s i know it might sound rather round the houses
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top