title: VBA outlook exception object, array index out of bound
body: <p>The below codes are from Outlook 2010 developer reference, explaining the use of " Exception.AppointmentItem Property" </p>
  
  <p>However while pasting and runing it, it pops up "array index out of bounds (run time error -2147352567(80020009) , and debug points to 
  Set myException = myRecurrPatt.Exceptions.item(1)</p>
  
  <pre><code>'Get the recurrence pattern for the master
  'AppointmentItem. Access the collection of
  'exceptions to the regular appointments.
  Set myRecurrPatt = myApptItem.GetRecurrencePattern
  Set myException = myRecurrPatt.Exceptions.item(1)
  
  'Display the original date, time, and subject
  'for this exception.
  MsgBox myException.OriginalDate &amp; ": " &amp; saveSubject
  </code></pre>
  
  <p>The problem persists after I changed the index to 0. Please help, thank you!</p>
  
  <p>Below is the full oringinal code:</p>
  
  <pre><code>Option Explicit
  
  Public Sub cmdExample()
  
      Dim myApptItem As Outlook.AppointmentItem
      Dim myRecurrPatt As Outlook.RecurrencePattern
      Dim myNameSpace As Outlook.NameSpace
      Dim myFolder As Outlook.Folder
      Dim myItems As Outlook.Items
      Dim myDate As Date
      Dim myOddApptItem As Outlook.AppointmentItem
      Dim saveSubject As String
      Dim newDate As Date
      Dim myException As Outlook.Exception
  
      Set myApptItem = Application.CreateItem(olAppointmentItem)
      myApptItem.Start = #2/2/2003 3:00:00 PM#
      myApptItem.End = #2/2/2003 4:00:00 PM#
      myApptItem.Subject = "Meet with Boss"
  
      'Get the recurrence pattern for this appointment
      'and set it so that this is a daily appointment
      'that begins on 2/2/03 and ends on 2/2/04
      'and save it.
      Set myRecurrPatt = myApptItem.GetRecurrencePattern
      myRecurrPatt.RecurrenceType = olRecursDaily
      myRecurrPatt.PatternStartDate = #2/2/2003#
      myRecurrPatt.PatternEndDate = #2/2/2004#
      myApptItem.Save
  
      'Access the items in the Calendar folder to locate
      'the master AppointmentItem for the new series.
      Set myNameSpace = Application.GetNamespace("MAPI")
      Set myFolder = myNameSpace.GetDefaultFolder(olFolderCalendar)
      Set myItems = myFolder.Items
      Set myApptItem = myItems("Meet with Boss")
  
      'Get the recurrence pattern for this appointment
      'and obtain the occurrence for 3/12/03.
      myDate = #3/12/2003 3:00:00 PM#
      Set myRecurrPatt = myApptItem.GetRecurrencePattern
      Set myOddApptItem = myRecurrPatt.GetOccurrence(myDate)
  
      'Save the existing subject. Change the subject and
      'starting time for this particular appointment
      'and save it.
      saveSubject = myOddApptItem.Subject
      myOddApptItem.Subject = "Meet NEW Boss"
      newDate = #3/12/2003 3:30:00 PM#
      myOddApptItem.Start = newDate
      myOddApptItem.Save
  
      'Get the recurrence pattern for the master
      'AppointmentItem. Access the collection of
      'exceptions to the regular appointments.
      Set myRecurrPatt = myApptItem.GetRecurrencePattern
      Set myException = myRecurrPatt.Exceptions.Item(1)
  
      'Display the original date, time, and subject
      'for this exception.
      MsgBox myException.OriginalDate &amp; ": " &amp; saveSubject
  
      'Display the current date, time, and subject
      'for this exception.
      MsgBox myException.AppointmentItem.Start &amp; ": " &amp; _
      myException.AppointmentItem.Subject
  End Sub
  </code></pre>