Platform SDK: CDO 1.2.1

GetPrevious Method (CDONTS Messages Collection)

The GetPrevious method returns the previous Message object in the Messages collection. It returns Nothing if no previous object exists, for example if already positioned at the beginning of the collection.

Syntax

Set objMessage = collMessages.GetPrevious( ) 
 
objMessage
On successful return, represents the previous Message object in the collection.
collMessages
Required. The Messages collection object.

Remarks

If the GetLast method has not been called since the Messages collection was initialized, the behavior of the GetPrevious 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 GetPrevious can produce unexpected results even if GetLast has been called.