OBJECT:  Folders Collection

Implemented in version 2.0
 
When using an instance of the Folder object, its SubFolder property returns a Folders collection consisting of all the subfolders (Folder objects) in that folder.

The following code illustrates how to get a Folders collection and display its contents in the browser.

Code:
<%
Dim filesys, demofolder, subfol, folcoll, folist
Set filesys = CreateObject("Scripting.FileSystemObject") 
Set demofolder = filesys.GetFolder(folderspec) 
Set folcoll = demofolder.SubFolders  
For Each subfol in folcoll
    folist = folist & subfol.Name  
    folist = folist & "<BR>"  
Next
Response.Write folist
%>


PROPERTIES

Count Property
Returns an integer that tells us how many Folder objects there are in the collection.

Syntax: object.Count

Item Property
The Item property allows us to retreive the value of an item in the collection designated by the specified key argument and also to set that value by using itemvalue.

Syntax: object.Item(key) [ = itemvalue]

METHODS

Add Method
This method is used to add a new Folder to a Folders collection.

Syntax: object.Add("foldername")


Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information