我目前有这个代码:
Function GetSubDir(ByVal sDir)
Dim oFS As New FileSystemObject
Dim oDir
iCount = 1
Erase subArray()
Set oDir = oFS.GetFolder(sDir)
For Each oSub In oDir.SubFolders
MsgBox oSubPath
GetSubDir oSub.Path
ReDim Preserve subArray(iCount)
subArray(iCount) = oSub.Path
iCount = iCount + 1
Next oSub
End Function
有没有办法修改它以获取文件和文件夹?我曾尝试查看 MSDN,但它对我来说很陌生,是简单的语法更改还是整个代码需要返工?谢谢