object.IsRootFolder
The object is always a Folder object.
The following code illustrates the use of the IsRootFolder property:
Dim fs Set fs = CreateObject("Scripting.FileSystemObject") Sub DisplayLevelDepth(pathspec) Dim f, n Set f = fs.GetFolder(pathspec) Iff.IsRootFolder
Then MsgBox "The specified folder is the root folder." Else Do Untilf.IsRootFolder
Set f = f.ParentFolder n = n + 1 Loop MsgBox "The specified folder is nested " & n & " levels deep." End If End Sub
Attributes Property | DateCreated Property | DateLastAccessed Property | DateLastModified Property | Drive Property | Files Property | Name Property | ParentFolder Property | Path Property | ShortName Property | ShortPath Property | Size Property | SubFolders Property | Type PropertyApplies To: Folder Object