Hi, Torstein,
Here's a function that returns the number of subdirectories by using the
FileSystemObject, along with a simple subroutine that shows how to use it:
Function CountSubFolders(FolderSpec As String) As Long
Dim oFileSystem, oFolder, FolderCollection
Dim oSubFolder
Set oFileSystem = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFileSystem.GetFolder(FolderSpec)
Set FolderCollection = oFolder.SubFolders
CountSubFolders = FolderCollection.Count
End Function
Sub test_it()
Dim c As Long
Dim sPath As String
With Dialogs(wdDialogFileOpen)
Do While .Display = -1 ' until canceled
' get path without file name
sPath = WordBasic.FileNameInfo(.Name, 5)
c = CountSubFolders(sPath)
MsgBox sPath & " contains " & c & " subfolders"
Loop
End With
End Sub

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word
> This seems to me as a simple question, but as a newbie I'm not able to
> figure out how to count all subdirectories directly under a given
[quoted text clipped - 7 lines]
>
> Torstein S. Johnsen