GetLast Method (AddressEntries Collection)

The GetLast method returns the last AddressEntry object in the AddressEntries collection. It returns Nothing if no last object exists.

Syntax

Set objAddressEntry = objAddrEntriesColl.GetLast( )

objAddressEntry
On successful return, represents the last AddressEntry object in the collection.
objAddrEntriesColl
Required. The AddressEntries collection object.

Remarks

The order that items are returned by GetFirst, GetLast, GetNext, and GetPrevious depends on whether the address entries are sorted or not. The AddressEntry objects within a collection can be sorted on a MAPI property of your choice, either ascending or descending, using the Sort method. When the items are not sorted, you should not rely on these methods to return the items in any specified order. The best programming approach to use with unsorted collections is to assume that the access functions are able to access all items within the collection, but that the order of the objects is not defined.

If an AddressEntries collection has not been enumerated since it was initialized, the behavior of the GetLast method is not defined. A collection is enumerated when you call its GetFirst method, access a member through its Item property, or use its Filter property to specify a message filter. Some providers may return CdoE_CALL_FAILED if you call GetLast before the collection is enumerated.