I am trying to create a VBA that will auto decline and delete all calendar invites that goes from users in the business to a SPECIFIC email (DL/Group). For business purpose I cannot remove myself from that group to receive all the emails just in case, but that also automatically adds invites into my calendar.
So far I have used this: https://www.extendoffice.com/documents/outlook/5054-outlook-auto-decline-meeting-from-specific-person.html
The problem is that it points to:
If VBA.LCase(xMeeting.SenderEmailAddress) = VBA.LCase("[email protected]") Then
I cannot find a command that will allow me to turn it into something such as: xMeeting.(Receiver/Receipient)EmailAddress
Is there any chance this could be done?
Also, I am using Outlook 365 and I have no option in rules management to select "Run a script". Is there any other way of doing it?
It messes up my calendar so much I need to find a way of doing it.
Thanks in advance!
Created a rule:
- sent to people or public group
- with specific words in the subject
- which is a meeting invitation or update
Added the VBA code from the link above and not sure how to change it to recipient instead of a sender. Also not having an option to select "run script" in rules.
Sounds like the sender email address is already known:
To get the recipient(s) of the item you need to use the corresponding property of Outlook items - the Recipients property returns a
Recipientscollection that represents all the recipients for the Outlook item. UseRecipients(index), whereindexis the name or index number, to return a singleRecipientobject. TheMeetingItemrecipient can be one of the followingOlMeetingRecipientTypeconstants:olOptional,olOrganizer,olRequired, orolResource(see theTypeproperty). For example: