开发者

Auto accept outlook VBA [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepti开发者_如何学Gong answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Improve this question

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?


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜