|
本帖最后由 oudaisei 于 2018-6-23 23:01 编辑
写了一个[取得文件夹及所有子文件夹中的文件列表]的处理,与大家共享。
请多多指正。
- Function getFilesFromDirectory(directoryName As String _
- , Optional filePattern As String = "*" _
- , Optional allowSubDirectory As Boolean = False _
- ) As Collection
- Dim directories As New Collection
- Dim baseDirectory As String, pathName As String, fullPath As String
-
- Set getFilesFromDirectory = New Collection
-
- baseDirectory = directoryName
- If (Right(baseDirectory, 1) <> "") Then
- baseDirectory = baseDirectory + ""
- End If
复制代码
|
|