Platform SDK: CDO 1.2.1 |
The GetNext method returns the next Message object in the Messages collection. It returns Nothing if no next object exists, for example if already positioned at the end of the collection.
Set objMessage = collMessages.GetNext( )
If the GetFirst method has not been called since the Messages collection was initialized, the behavior of the GetNext method is not defined. This can produce unexpected results if the collection is reinitialized with a Set statement in every iteration of a loop. The recommended procedure is to Set an explicit variable for the collection before entering the loop.
If the collection is empty, calling GetNext can produce unexpected results even if GetFirst has been called.