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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top