删除拒绝的会议

删除拒绝的会议

我正在运行 Outlook 2007。当我发送一对一会议邀请而对方拒绝时,我怎样才能从我的日程表中删除此会议而不向拒绝的人发送取消通知?

当我尝试删除会议时,Outlook 坚持发送取消通知。

答案1

我正在使用以下 VBA 子程序从日历中删除约会。

Public Sub deleteSelectedAppointment()
    Dim obj As Object
    Dim cl As Integer
    Dim apt As AppointmentItem
    Dim aptDel As AppointmentItem
    Dim pattern As RecurrencePattern
    Dim cnt As Integer

    On Error GoTo ErrHandler

    cnt = 0
    For Each obj In ActiveExplorer.Selection
        cl = obj.Class

        Select Case cl
        Case olMail
        Case olTask
        Case olAppointment
            Set apt = obj
            Debug.Print "Appointment " & apt.subject

            If apt.IsRecurring Then
                '  find and delete the selected item in a series
                Set pattern = apt.GetRecurrencePattern()
                Set aptDel = pattern.GetOccurrence(apt.Start)
            Else
                '  non-recurring appointment
                Set aptDel = apt
            End If

            If aptDel Is Nothing Then
                Debug.Print "Nothing to delete!"
            Else
                aptDel.Delete
                cnt = cnt + 1
            End If

        Case Else
            Debug.Print "unexpected class " & cl
        End Select
    Next obj

    Debug.Print "Deleted appointments: " & cnt

    Exit Sub

ErrHandler:
    MsgBox "Cannot delete appointment" & vbCrLf & Err.Description, vbInformation
    Err.Clear
    On Error GoTo 0

End Sub

它也适用于任务和邮件。显然,这样的例程可能会删除很多如果使用不当...

相关内容