locked
Update AppointmentItem Date RRS feed

  • Question

  • I send out calendar events for a business flow.  On occasion I need to update the date for the event.  I use to attach an .ICS file to an email which allows you to do this using the SEQUENCE and UID keywords.  I switched to sending it out in Outlook since it provides a better user interface.  User can just click Accept.  The thing is I don't know how to update date.  I get no reference to event.  Does anyone know how to send out an update the date of an existing event?

    Sub TestEvent()
      Dim oApp As New Outlook.Application
      Dim appt As Outlook.AppointmentItem
      Dim msg As Outlook.MailItem
      Dim oAcc As Outlook.Account
      
      On Error GoTo handler
      
      Set appt = oApp.CreateItem(olAppointmentItem)
      Set msg = oApp.CreateItem(olMailItem)
      Set oAcc = oApp.Session.Accounts.Item(2)
      appt.MeetingStatus = olMeeting
      If EMAILTEST Then
        appt.RequiredAttendees = "" '
      Else
        appt.RequiredAttendees = ""
        appt.OptionalAttendees = ""
      End If
      appt.Location = "  "
      msg.HtmlBody = s   ' s = HTML text
      'Kludge to get HTML in Appointment item.  Create in email and copy to appointment
      msg.GetInspector().WordEditor.range.FormattedText.Copy
      appt.GetInspector().WordEditor.range.FormattedText.Paste
      appt.Start = md  ' md = Date for Appointment
      appt.AllDayEvent = True
      appt.ReminderSet = False
     ' appt.End = md + 1
      sb = ""
      appt.Subject = ""
      appt.SendUsingAccount = oAcc
      appt.Display
      appt.ReminderMinutesBeforeStart = 60
      appt.send
      Set msg = Nothing
      Set appt = Nothing
      Set oAcc = Nothing
      Set oApp = Nothing
    
      Exit Sub
      
    handler:
      Call MsgBox(Err.Number & ": " & Err.Description, vbOKOnly, "Email Send Error")
      Err.Clear
    
    End Sub


    • Edited by mogulman52 Wednesday, April 15, 2020 6:51 PM
    Wednesday, April 15, 2020 6:48 PM