title: Iterating quickly through Outlook appointment items
body: <p>I've written a macro which iterates through a users calendar and makes modifications to entries that fufil a certain critera.</p>
  
  <p>The problem is that when the calendar is very big, this takes a long time to do. I don't seem to be able to filter the appointments because <code>oAppointmentItems</code> seems to store entries as they were created - which is not necessarily the same order as when they start.</p>
  
  <p>The code I'm using is this:</p>
  
  <pre><code>Dim oOL As New Outlook.Application
  Dim oNS As Outlook.NameSpace
  Dim oAppointments As Object
  Dim oAppointmentItem As Outlook.AppointmentItem
  
  Set oNS = oOL.GetNamespace("MAPI")
  Set oAppointments = oNS.GetDefaultFolder(olFolderCalendar)
  
  For Each oAppointmentItem In oAppointments.Items
  
      DoEvents
      ' Something here
  Next
  
  Set oAppointmentItem = Nothing
  Set oAppointments = Nothing
  Set oNS = Nothing
  Set oOL = Nothing
  </code></pre>
  
  <p>Short of removing the <code>DoEvents</code> (which only means that Outlook appears to lock up to the user) is there any way I can speed this up by applying some kind of filter? For example, appointments which start in the future.</p>