Search a subfolder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
Does anyone knows how to search (in code) if a subfolder exists. and how to
inquire if the subfolder has its on childrens?
Thanks a lot in advance
 
Here is an example

Dim oFSO As Object
Dim oFolder As Object

Set oFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Set oFolder = oFSO.getfolder("C:\myTest")
On Error GoTo 0
MsgBox oFolder Is Nothing
If Not oFolder Is Nothing Then
MsgBox oFolder.subFolders.Count
End If

Set oFolder = Nothing
Set oFSO = Nothing


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks bob but i'm looking for a way to inquire the Inbox tree and not the
file server tree.
Did i make myself clear?
 
If oFolder is your folder object then oFolder.Folders.Count would tell you
how many child folders there are if any. All MAPIFolder objects have a
Folders collection of children, which may or may not be populated. To start
at Inbox use NameSpace.GetDefaultFolder(olFolderInbox).
 
Back
Top