home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1996 July / PCPRO0796.ISO / code / winint / listing6.txt < prev   
Encoding:
Text File  |  1996-04-29  |  899 b   |  22 lines

  1. æwalk the folder tree structures
  2. Function Util_ListFolders(objParentFolder As Object)
  3. Dim objFoldersColl As Object                         ' the child Folders collection
  4. Dim objOneSubfolder As Object                      'a single Folder object
  5.     On Error GoTo error_olemsg
  6.     If Not objParentFolder Is Nothing Then
  7.         MsgBox ("Folder name = " & objParentFolder.Name)
  8.         Set objFoldersColl = objParentFolder.Folders
  9.         If Not objFoldersColl Is Nothing Then       ' loop through all
  10.             Set objOneSubfolder = objFoldersColl.GetFirst
  11.             While Not objOneSubfolder Is Nothing
  12.                 x = Util_ListFolders(objOneSubfolder)
  13.                 Set objOneSubfolder = objFoldersColl.GetNext
  14.             Wend
  15.         End If
  16.     End If
  17.     Exit Function
  18. error_olemsg:
  19.     MsgBox "Error " & Str(Err) & ": " & Error$(Err)
  20.     Resume Next
  21. End Function
  22.