GetFirst Method

GetFirst Method

See Also         Example         Applies To

The GetFirst method returns the first object in the collection. Returns Nothing if no first object exists, for example, if there are no objects in the collection.

Note: To ensure correct operation of the GetFirst, GetLast, GetNext, and GetPrevious methods in a large collection, call GetFirst before calling GetNext on that collection, and call GetLast before calling GetPrevious. To ensure that you are always making the calls on the same collection, create an explicit variable that refers to that collection before entering the loop.

Syntax

Set object. objCollection.GetFirst()

Object   Required. On successful return, represents the first object in the collection.

objCollection   Required. The collection object.