Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto accept outlook VBA [closed]

Tags:

vba

outlook

Is there a VB macro or some sort of add-on out there that will allow me to auto accept invitations in outlook by sender or by folder?

I was thinking about doing a VB script for this but I don't want to re-invent the wheel?

like image 457
Russ Avatar asked Nov 05 '22 15:11

Russ


1 Answers

I have used this in the past add this sub into VBA page and the wire up your rule so that it fires when you receive it from certian senders and ita meeting invite or update.

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
like image 95
76mel Avatar answered Nov 11 '22 15:11

76mel