自动接受Outlook VBA

Rus*_*uss 5 outlook vba outlook-vba

是否有VB宏或某种附加组件允许我通过发件人或文件夹自动接受Outlook中的邀请?

我正在考虑为此做一个VB脚本,但我不想重新发明轮子?

76m*_*mel 2

我过去曾使用过此功能,将此子添加到 VBA 页面中并连接您的规则,以便当您从某些发件人收到它并且 ita 会议邀请或更新时触发它。

Sub AutoAccept(ByRef Item As Outlook.MeetingItem)

  Dim strID As String
  Dim olNS As Outlook.NameSpace
  Dim oMeetingItem As Outlook.MeetingItem
  Dim oResponse As Outlook.MeetingItem
  Dim oAppointment As Outlook.AppointmentItem

  strID = Item.EntryID

  Set olNS = Application.GetNamespace("MAPI")
  Set oMeetingItem = olNS.GetItemFromID(strID)
  Set oAppointment = oMeetingItem.GetAssociatedAppointment(True)

  Set oResponse = oAppointment.Respond(olMeetingAccepted)
  oResponse.Send

  oAppointment.Save
  oMeetingItem.Save


  Set oAppointment = Nothing
  Set oMeetingItem = Nothing
  Set olNS = Nothing

End Sub
Run Code Online (Sandbox Code Playgroud)