FindNext Method

Applies To

Items collection object.

Description

After the Find method runs, this method finds and returns the next Outlook item in the collection. The search operation begins from the current position, which matches the expression previously set through Find.

Syntax

expression.FindNext

expression An expression that returns an Items object.

See Also

Find method, Restrict method.

Example

This example displays in a series of message boxes all the appointments occurring today.

tdystart = Format(Date, "Short Date") & " 12:00 AM"
tdyend = Format(Date, "Short Date") & " 11:59 PM"
Set myAppointments = olNameSpace.GetDefaultFolder _
    (olFolderCalendar).Items
Set currentAppointment = myAppointments.Find("[Start] >= """ & _
    tdystart & """ and [Start] <= """ & tdyend & """")
While TypeName(currentAppointment) <> "Nothing"
    MsgBox currentAppointment.Subject
    Set currentAppointment = myAppointments.FindNext
Wend