1

I like to keep track of meetings even after they were cancelled. It helps me go back to review activity taken for various topics and, sometimes, explain why I didn't go to your meeting. (E.G., "There was a recurring meeting at the same time but the chair has since canceled it and deleted the entire series instead of just the future ones.")

I tried using the script posted on slipstick.com as a few different search results kept pointing me back to that same article. However, it didn't work quite right for me. Is there an easier way?

Here's a copy of that script:

Sub CopyMeetingtoAppointment(oRequest As MeetingItem)

If oRequest.MessageClass <> "IPM.Schedule.Meeting.Canceled" Then
  Exit Sub
End If

Dim oAppt As AppointmentItem
Dim cAppt As AppointmentItem

Set cAppt = oRequest.GetAssociatedAppointment(True)
Set oAppt = Application.CreateItem(olAppointmentItem)

'I added (Rule) to the subject so I could see the rule was working. 
    oAppt.Subject = "(Rule) Canceled: " & cAppt.Subject
    oAppt.Start = cAppt.Start
    oAppt.Duration = cAppt.Duration
    oAppt.Location = cAppt.Location
    oAppt.Display
    oAppt.Save

    Set oAppt = Nothing
    Set cAppt = Nothing
End Sub

You're supposed to setup a rule to go along with it and I think that part is fine:

Screenshot

1 Answer 1

1

After fiddling with it, I found a much easier way to copy the calendar event to an appointment item: Use the actual copy method. I've tested it in various scenarios, especially with recurring meetings, and it has performed flawlessly. I've set it to remove any reminders and set yourself as free during that time. In addition, I added a note about who canceled it. If there are any other improvements that people can find, I would welcome them.

Sub CopyMeetingToAppointment(oRequest As MeetingItem)

    'Double-check in case of accidental run
    If oRequest.MessageClass <> "IPM.Schedule.Meeting.Canceled" Then Exit Sub

    'Declare the objects
    Dim oAppt As AppointmentItem
    Dim cAppt As AppointmentItem
    Dim cancelMessage As String

    'Create the objects
    Set cAppt = oRequest.GetAssociatedAppointment(True)
    Set oAppt = cAppt.Copy

    'Create the cancel message
    cancelMessage = vbNewLine & vbNewLine & " - - - - - - - - - - - - - - - - - - - " & vbNewLine & _
        "Meeting was canceled by " & oRequest.SenderName & " <" & oRequest.SenderEmailAddress & "> on " & oRequest.ReceivedTime

    'Modify the copied appointment
    With oAppt
        If UCase(Left(.Subject, 6)) = "COPY: " Then .Subject = Mid(.Subject, 7)
        .Subject = "[BKP] " & .Subject
        .Body = .Body & cancelMessage
        .ReminderSet = False
        .BusyStatus = olFree
        .Save
    End With

    'Cleanup
    Set oAppt = Nothing
    Set cAppt = Nothing

End Sub
4
  • Does this fire when a meeting is cancelled or removed? Or does it need to be called? Jan 28, 2016 at 17:10
  • Ah, good point. I setup a rule, as specified in the link in OP. I'll add that. Jan 28, 2016 at 17:11
  • Oh, I missed that part. Very cool then. No need for error handling? Jan 28, 2016 at 17:12
  • 1
    @Raystafarian I'm pretty lazy about error handling... I could throw in something basic like On Error GoTo errHandler and have it pop a message. However, I kind of like it throwing errors at me because then I go fix whatever was causing it. Jan 28, 2016 at 17:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .