- Home
·
- Miscellaneous
·
- Recursive Function to Check Folders / Files Under the Passed Folder
Recursive Function to Check Folders / Files Under the Passed Folder
Recursive Function to Check Folders / Files Under the Passed Folder
API Declarations
Global arrFileSend() As String
Rate Recursive Function to Check Folders / Files Under the Passed Folder
(1(1 Vote))
Private Function fnGotoFolders(ByVal folToCheck As Folder)
'Go through the folders and Store files to array and process
On Error GoTo LOCALERRORHANDLER
Dim objFile As File 'A file of the folder
Dim objfolder As Folder 'A folder in side a folder
Dim objFSO As New FileSystemObject
If folToCheck <> "" Then
For Each objFile In folToCheck.Files
'Call a function to process the file which is received
If intTotFile = 0 Then
arrFileSend(intTotFile) = CStr(objFile)
intTotFile = intTotFile + 1
Else
ReDim Preserve arrFileSend(intTotFile)
arrFileSend(intTotFile) = CStr(objFile)
intTotFile = intTotFile + 1
End If
Next
For Each objfolder In folToCheck.SubFolders
Call fnGotoFolders(objfolder)
Next
Set objFSO = Nothing
End If
Exit Function
LOCALERRORHANDLER:
End Function
Recursive Function to Check Folders / Files Under the Passed Folder Comments
No comments yet — be the first to post one!
Post a Comment