检查 outlook 中的会议是否已被接受

Check if a meeting in outlook is already accepted

早上好。我有一个项目,该项目包括为多人之间的汽车定位制定计划。目的是让那些有优先权处理此任务的人使用汽车。所以要做到这一点,当他们计划与一个人(汽车)会面时,我的 vba 代码必须识别优先的人,并向他们回应 'yes',并且 'no' 给其他人。我的 vba 代码获取所有日历会议项目并计划它们。

问题是,当会议被拒绝时,它会从日历中消失,而当它被接受时,它会保留下来。我想知道一个会议项目是否已经被接受,以避免再次计划它。

collectionItem.Respond(olMeetingAccepted, bool) 方法不允许这样做。我试过 ResponseStatus 但我不明白它什么时候起作用。请帮忙!

when it is accepted, it stay.

ResponseStatus property of the AppointmentItem class returns an OlResponseStatus constant indicating the overall status of the meeting for the current user for the appointment. See the OlResponseStatus Enumeration 可能的值。

我找到了解决办法,多亏了你。 link 帮助我使用 ResponseStatus。我很愚蠢,它是如此简单,就是代码:

Dim oAppointmentItem As Outlook.AppointmentItem

For Each oAppointmentItem In oAppointments.Items
        dDate = DateValue(oAppointmentItem.Start)
        If dDate = DateValue(Date) Then
               //line I want is the next
            If (oAppointmentItem.ResponseStatus = olResponseAccepted) Then
            Else
                If ItemExist(listDestZone, oAppointmentItem.Location) Then
                    Set varDestZone = listDestZone.Item(oAppointmentItem.Location)

                Select Case varDestZone.zone
                    Case zone1: MeetingsZone1.Add oAppointmentItem
                    Case zone2: MeetingsZone2.Add oAppointmentItem
                    Case zone3: MeetingsZone3.Add oAppointmentItem
                    Case zone4: MeetingsZone4.Add oAppointmentItem
                End Select
            End If
        End If
    End If
Next

谢谢