Function ListSubFolders(startmapp)
Set FileList = CreateObject("Scripting.Dictionary")
Set fso = CreateObject("Scripting.FileSystemObject")
TreeView1.Nodes.Add , , startmapp, startmapp
Set folderobj = fso.GetFolder(startmapp)
Set fc = folderobj.SubFolders
For Each mapp In fc
TreeView1.Nodes.Add startmapp, tvwChild, mapp.Name, mapp.Name
Next
End Function
Private Sub Command1_Click()
ListSubFolders ("c:/program/")
End Sub