FolderRightsCollection

A collection of FolderRights objects.

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

Folder. The Folder object that owns this collection.

Methods

Add(VARIANT Address, Long Rights)

If Address is an Address object, this method creates a new FolderRights object for that address. If Address is an Addresses collection, this method creates a new FolderRights object for each address in the collection. Rights specifies the rights to be given. The value for Rights is derived from combining FolderRightsConstants with the bitwise inclusive OR operator.

  • Because there is seldom need to access a new FolderRights object immediately after it is created, this Add method does not return the newly created object.

  • Because only personal folders can be shared, this method throws an exception if the owning folder's ObjType property is not egwPersonal.

Passing an Address object that refers to a group will expand the group and add each contained user individually.

To share a folder, you must call the Commit method after calling this Add method.

Commit(String Subject, String BodyText, [FolderRightsNotifyConstants TypeCommit])

Commits the changes made to the collection.

  • Unlike other collections in the Object API, the FolderRightsCollection does not save changes unless the Commit method is called. Calling this method will cause a notification message to be sent to the affected users. For example, if you add users to this collection, calling Commit will send the sharedfolder message to those users.

  • TypeCommit indicates what changes are being committed. If TypeCommit is omitted, all shared users are notified.

FolderRights Item(VARIANT Index)

DEFAULT. Returns the FolderRights object specified by Index. Index may be a Long, a string representing a Long, or an Address object. If Index is a Long, or a string representing a Long, returns the FolderRights 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 an Address object, returns the FolderRights object whose Address is equal to Index.

NOTE:The FolderRightsCollection essentially has a distribution list (or a list of AddressBookEntries) of users that have shared rights to the folder in question. Because this method expects an AddressBookEntry that is in this distribution list, you can pass in an AddressBookEntry of a user that has shared rights for the folder only.

Remarks

A FolderRights collection is refreshed when its parent object is refreshed. When a FolderRights collection is refreshed, it recursively refreshes its contained FolderRights objects.

Adding the first FolderRights object to a FolderRights collection changes the owning folder to a shared folder (the folder’s Shared property changes to egwSharedOutgoing). Deleting the last FolderRights object changes the folder back to unshared (the folder’s Shared property changes to egwNotShared). All of these changes occur after the Commit method is called.