SortItems
Previous  Next

Sorts the items in the collection using the specified property.
Syntax: SortItems (Property As String, Descending As Boolean)
Property - One of the item's properties.
Descending - True to sort the list in descending order, false otherwise.

Example:
'PimCol is a PimCollection object and Appointment is an Appointment object.
Sub Globals
      
End Sub

Sub App_Start
      Form1.Show
      Appointment.New1
      PimCol.New1("Appointments")
      PimCol.SortItems("Start",false)
      i = 0
      Do
            Appointment.Value = PimCol.GetItem(i)     
            i = i + 1
      Loop While i < PimCol.Count AND Appointment.Start < now 'Finds the next appointment.
      If i<=PimCol.Count Then
            msgbox("Next appointment will be on: " & Time(Appointment.Start))
      End If
End Sub