Try using a recursive procedure call. It is good for looping through tree
Here is some sample code.
' Microsoft Scripting Runtime
Public Sub LoopThroughFiles(RootFolder As String)
Dim fs As FileSystemObject
Dim fld As Folder
Set fs = New FileSystemObject
Set fld = fs.GetFolder(RootFolder)
'this is a recursive procedure that will
'loop through the directory you specify
'and any sub folders
Private Sub GetFiles(fld As Folder)
Dim fldSub As Folder
Dim fil As File
For Each fldSub In fld.SubFolders
'if the folder passed in has sub
'folders, call itself.
For Each fil In fld.Files
Debug.Print fld.Path & fil.Name & " | " & fil.Attributes
Hope it helps.
From: Nigel [mailto:nigel.parker@c...]
Sent: Wednesday, April 04, 2001 1:54 AM
To: professional vb
Subject: [pro_vb] Resetting All Attributes Within A Given Folder
A quick question, I hope...
Does anyone of a quick way to loop through all of the files within a
folder and its sub foders and clear all of the file attributes no matter
what file type they are?