5,139
社区成员
发帖
与我相关
我的任务
分享
Public Fso As Object
Public Str As String
Sub getFldList()
Set Fso = CreateObject("Scripting.FileSystemObject")
Fldnm ("C:\TEST")
MsgBox Str
End Sub
Function Fldnm(pth$)
Dim Fld
For Each Fld In Fso.getfolder(pth).subfolders
If Fld.Name Like "*ASD*" Then Str = Str & Fld.Name & " "
Fldnm (Fld)
Next
End Function
Str = ""
Set Fso = CreateObject("Scripting.FileSystemObject")
For Each Fld In Fso.GetFolder("C:\TEST").SubFolders
If Fld.Name Like "*ASD*" Then Str = Str & Fld.Name & " "
Next
MsgBox Str