问题描述:

how to use Dir() function in Dir() function loop?(local Dir())

I need to read directory, than read sub directory and take file.

Dim Path as String

Path = "D:/Path/"

Dim DH as String 'iterator for Dir()

DH = Dir(Path)

Do While DH<>""

IF (GetAttr(Path + DH) and vbDirectory) = vbDirectory Then 'directory? yes

ReadThisDirectory(Path + DH + "/")

End If

Loop

Sub ReadThisDirectory(dir_path as string)

Dim MyVar as String

MyVar = dir_path + Dir(dir_path)

End Sub

相关阅读:
Top