Returning an Object from a Collection

The Item property returns a single object from a collection. The following example sets the dscSupplies variable to a Discussion object that represents the first discussion in the Discussions collection.

Dim dscDiscussions As Discussions
Set dscDiscussions = _
    OpenDiscussions("http://samples.microsoft.com")
Dim dscSupplies As Discussion
Set dscSupplies = dscDiscussions.Item(1)
		

Because the Item property is the default property for most collections, you can write the same statement more concisely by omitting the Item keyword.

Set dscSupplies = dscDiscussions(1)
		

For more information about a specific collection, see the Help topic for the collection or the Help topic for the collection’s Item property.