Advertisement
C_Volume2 Files/ File Controls/ Input/ Output #73329

RecurseFolderList

This code is a modified version of ShowFolderList by Bruce Lindsay. (Thanx !!) This code will recursively parse a directory defined by an path parameter. My aim was to work around the non-recursive nature of the dir function. Bruce's original code does that to one folder/child level. Mine now returns everything below a given path. You can still use getattr to define Folder or File attributes.

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
Function RecurseFolderList(foldername)
 Dim fso, f, fc, fj, f1
 Set fso = CreateObject("Scripting.FileSystemObject")
 Set f = fso.GetFolder(foldername)
 Set fc = f.Subfolders
 Set fj = f.Files
    
 'For each subfolder in the Folder
 For Each f1 In fc
  'Do something with the Folder Name
  debug.print f1
  'Then recurse this function with the sub-folder to get any sub-folders
  RecurseFolderList(f1)
 Next	
 
 'For each folder check for any files
 For Each f1 In fj
  debug.print f1
 Next
End Function
Upload
Bình luận gốc (3)
Được khôi phục từ Wayback Machine