如果同时有另一个会议,则自动暂定接受会议

时间:2019-05-17 16:16:25

标签: vba outlook

如果邀请与其他会议发生冲突,我会尝试创建一个宏来自动临时接受会议。

我尝试编写一些代码,但未检测到冲突

Sub TentativelyAcceptMeetingsIfConflict(oRequest As MeetingItem)

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

Dim oAppt As AppointmentItem
Set oAppt = oRequest.GetAssociatedAppointment(True)

MsgBox (oAppt.Conflicts.Count)
MsgBox (oRequest.Conflicts.Count)

If oAppt.Conflicts.Count > 0 Then

    MsgBox ("There is a conflict with this invitation")

    Dim oResponse
       Set oResponse = oAppt.Respond(olMeetingTentative, True)
       oResponse.Display

End If

End Sub

我尝试使用MsgBox查看冲突数量,但始终为0。

0 个答案:

没有答案