【问题标题】:How can I silently decline a meeting?我怎样才能默默地拒绝会议?
【发布时间】:2020-06-21 07:27:22
【问题描述】:

我目前有一个绑定到规则的脚本,以便我可以自动拒绝某些主题的会议请求:

Sub AutoDeclineMeetings(oRequest As MeetingItem)

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

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

Dim oResponse
 Set oResponse = oAppt.Respond(olMeetingDeclined, True)
 oResponse.Send

End Sub

但是,这会将响应发送回会议组织者,这会不必要地向他们发送垃圾邮件,因为他们不在乎我是否参加。

如何更改此代码以使会议不显示在我的日历中并且不发送响应?我试过简单地调用oAppt.Delete 和oRequest.Delete,但这不会从我的日历中删除该项目。

实际上,我正在寻找的相当于在会议请求上手动选择拒绝 -> 不发送回复。

【问题讨论】:

  • 如果他们不在乎你是否参加,为什么不回复,为什么不直接删除请求?
  • @JoeEnos 我相信我已经尝试删除 AppointmentItem (似乎没有效果)和 Request (删除了实际的电子邮件请求,但在我的日历中留下了会议),但我'将测试并仔细检查。
  • 我刚刚仔细检查(通过调用oAppt.Delete 和oRequest.Delete),该项目仍在我的日历中。

标签: vba outlook


【解决方案1】:

不要做oResponse.Send,试试oResponse.Close(olDiscard)

【讨论】:

  • 不幸的是,这似乎并没有真正挽救我拒绝的事实,因为它仍然出现在我的日历中并显示“此会议尚未被接受”。当我将鼠标悬停在它上面时。我也试过oResponse.Close(olSave),也没用。
  • 我可能还有其他问题,因为现在我之前发送拒绝响应的脚本似乎也不起作用。所以也许这确实有效,我设法做了一些阻止它执行的事情。我现在无法确认或否认这个答案。其他人可以吗?
  • @Sterno 您的问题中的相同代码是不起作用的代码吗?或者你有没有修改它,使它不再工作?如果是这样,您能否使用当前版本的脚本更新问题?
  • 我的问题中粘贴的完全相同的代码不再适用于我,尽管它是在星期五。这让我想知道我是否以某种方式搞砸了运行脚本的规则(尽管我真的不明白如何)。
  • 尝试确保您没有更改安全设置,以便不再启用宏。我唯一能想象的就是代码根本没有运行,而不是不正确。
【解决方案2】:

删除响应而不是发送它:

oResponse.Delete 而不是oResponse.Send

Sub DeclineSelected()
    Dim Session As Outlook.NameSpace
    Dim currentExplorer As Explorer
    Dim Selection As Selection
    Dim currentItem As Object
    Dim oAppt As AppointmentItem
    Dim oResponse

    Set currentExplorer = Application.ActiveExplorer
    Set Selection = currentExplorer.Selection

    'For all items selected...
    For Each currentItem In Selection
        'If it is a meeting request...
        If currentItem.MessageClass = "IPM.Schedule.Meeting.Request" Then
            Set oAppt = currentItem.GetAssociatedAppointment(True)
            If oAppt.ResponseRequested Then
                Set oResponse = oAppt.Respond(olMeetingDeclined, True, False)
                oResponse.Delete
            Else
                Set oResponse = oAppt.Respond(olMeetingDeclined, True, False)
            End If
            currentItem.Delete

        'If it is a meeting cancellation...
        ElseIf currentItem.MessageClass = "IPM.Schedule.Meeting.Canceled" Then
            Set oAppt = currentItem.GetAssociatedAppointment(True)
            If oAppt Is Nothing Then
                currentItem.Delete
            End If

    'Delete if just an email...
        ElseIf currentItem.MessageClass = "IPM.Note" Then
            currentItem.Delete
        End If

    Next
End Sub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-06
    • 2016-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-03
    • 2023-03-10
    • 2020-04-06
    相关资源
    最近更新 更多