Microsoft® Visual Basic® Scripting Edition IsRootFolder Property |
Scripting Run-Time Reference Version 3 |
Returns True if the specified folder is the root folder; False if it is not.
object.IsRootFolderThe object is always a Folder object.
The following code illustrates the use of the IsRootFolder property:Function DisplayLevelDepth(pathspec) Dim fso, f, n Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(pathspec) If f.IsRootFolder Then DisplayLevelDepth = "The specified folder is the root folder." Else Do Until f.IsRootFolder Set f = f.ParentFolder n = n + 1 Loop DisplayLevelDepth = "The specified folder is nested " & n & " levels deep." End If End Function