Find number of sub Folders

  • Thread starter Thread starter MarkS
  • Start date Start date
M

MarkS

Hi,
I need to find a sub folder on different machine, which always has the same
Name. I have got this far

Set SourceFolder = mynamespace.Folders("Personal Folders")
For iLoopCounter = 1 To Something
If SourceFolder.Folders(iLoopCounter) = "AFMA" Then
Set TargetFolder = SourceFolder.Folders(1)
iLoopCounter = Something + 1
End If
Next

I need to know what to put in place of something to get the number of sub
folders that exist

Thanks
 
You're making it too hard. Because folder names are unique in each collection, you can get the folder directly:

TargetFolder = SourceFolder.Folders("AFMA")

If you really needed the number of folders, that would be returned by the Folders.Count property. Remember, the object browser is your friend.
 
Back
Top