ISSourceFolders.Count

Description

The number of the source folders within the collection.

Syntax

object.Count

Part Attribute Type Description
object Required
The object always implements the ISSourceFolders interface
Restriction: This property is readonly.

Return Value

int

Example

Create new folders with the specified paths and display some information about the folder tree.

sub main
  Dim aStore
  Dim aMessage 
  
  set aStore = Profile.SourceStore
  EnsureFolder aStore, "Examples"
  EnsureFolder aStore, "Examples/Part1"
  EnsureFolder aStore, "Examples/Part2"  
 
  aMessage = GetSubfoldersInfo(aStore, "", 0)

  Profile.MsgBox(aMessage)
end sub
    

function GetSubfoldersInfo(aStore, aPath, aLevel)
  Dim aFolders, aFolder
  Dim i
  Dim aInfo

  set aFolders = aStore.GetFolders(aPath)

  for i = 0 to aFolders.Count - 1
    set aFolder = aFolders.GetItem(i)
    aInfo = aInfo & vbNewLine & Space(aLevel * 4) & aFolder.FullPath &_ 
      GetSubfoldersInfo(aStore, aFolder.FullPath, aLevel + 1)
  next  
  
  GetSubfoldersInfo = aInfo
end function
    
    
sub EnsureFolder(aStore, aFolderName)
  Dim aFolder

  on error resume next 
  set aFolder = aStore.GetFolder(aFolderName)
  if Err.Number <> 0 Then
    Err.Clear  
    set aFolder = aStore.CreateFolder(aFolderName)
    Profile.MsgBox("The folder '" & aFolder.FullPath & "' was created")
  end if  
end sub
Note:

Version information

Added in v7.8.0