3.55 Folders2

Contains a collection of Folder objects.

3.55.1 Properties

The following table lists properties along with their access and descriptions.

Property

Access

Description

Application

R/O

Application. The Application object.

Count

R/O

Long. The number of objects in this collection.

_NewEnum

R/O

Enumeration object. Implements IEnumVARIANT. For Windows only.

Parent

R/O

Object. The Folder or Message object that owns this collection.

3.55.2 Methods

Folder Add(SharedNotification SharedMessage, [String Name])

Creates a shared folder based on the information stored in the SharedNotification object SharedMessage. The folder can optionally be named by passing in the Name parameter. SharedNotification messages are generated by the Commit( ) method of the FolderRightsCollection and have a class name of GW.MESSAGE.MAIL.NGW.SHARED.FOLDER.NOTIFY. Calling this method causes the original shared folder notification message to be deleted. References to the shared folder notification message should be immediately released after calling this Add method. Query and system folders cannot be parents for other folders. Invoking the Add method on these folders will throw an exception.

The Add method does not allow child folders to be created under the Mailbox, Calendar, Contacts, Sent Items, or Checklist folders. Also, the Add method does not allow child folders to be created under any Query folder.

This method adds a folder only at the current folder level and won't accept path arguments that contain the backslash (\) character. If you want to add a folder to a subfolder level (such as beneath the Cabinet folder), you must first get the Folders collection beneath the top level folder (for example, the Cabinet folder) and then call the Add method.

Folder Add(String Name)

Creates a new personal folder. To create a new query folder, see the Query object. Query and system folders cannot be parents for other folders. Invoking the Add method on these folders will throw an exception.

Folder Item(VARIANT Index)

DEFAULT. Returns the Folder object specified by Index. Index may be a Long or a string. If Index is a Long, returns the Folder object located at the given Index in the collection. Valid indexes are 1 through Count, inclusive. Throws an exception if the Index is outside of this range. If Index is a string, returns the Folder object whose FolderID is equal to Index.

Folder ItemByName(String Name)

Returns the Folder object specified by Name.

Refresh()

Forces the object in a Folders collection to reread all subfolders from the database that belong to this collection. Note that new folders might have been added to the collection and old folders might have been deleted.

3.55.3 Remarks

The Add method template is as follows:

Add(VARIANT P1, [VARIANT P2]).

The Add method checks the P1 type at runtime.

  • If P1 is a SharedNotification object, the first form of Add is assumed; P2, if present, must be a string.

  • If P1 is a String, the second form of Add is assumed; P2 if present, is ignored.

The Add method does not allow child folders to be created under the Mailbox, Calendar, Contacts, Sent Items, or Checklist system folders, or under any Query folder.

A Folders collection is refreshed when its parent object is refreshed. When a Folders collection is refreshed, it updates the Folder objects in the collection, but it does not recursively refresh the Folder objects themselves.