Help with macro to answer and delete calendar requests?

Status
Not open for further replies.

EdNerd

Member
Outlook version
Email Account
Exchange Server
I copied the following code from http://www.slipstick.com/outlook/calendar/autoaccept-a-meeting-request-using-rules/ to accept calendar requests. It works, except for three questions.

Code:
Sub AutoAcceptMeetings(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(olMeetingAccepted, True)
oResponse.Display
oResponse.UnRead = False
oResponse.Delete

End Sub

Questions:

(1) I get a pop-up prompt every time "The sender will not be sent a response. Is this okay?" Of course it is - that's why I'm doing this by code. :8>) Is there any way to not see this pop-up?

(2) The .Unread is NOT marking the item as Read, at least as it's displayed in my Inbox. Do I have the wrong property?

(3) .Delete is not deleting the item from my Inbox. Is there a different way to do this?

Ed
 

EdNerd

Member
Outlook version
Email Account
Exchange Server
Okay -- we just got "upgraded" to Office 2013. (The jury is still out on the "up" part!!)
My macro creates a response and deletes the request.
But the response gets saved as a draft and is not added to the calendar.
Does this need to be adjusted for OL13?
Code:
Sub AutoAcceptMeetings(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(olMeetingAccepted, True)
oResponse.Close (olSave)

oRequest.UnRead = False
oRequest.Delete

End Sub
 

EdNerd

Member
Outlook version
Email Account
Exchange Server
I adjusted the macro. It saves to the calendar. But it also saves a draft.
Can I avoid creating the Draft? Or do I have to intercept and delete it?

Here's the part that's doing the work:
Code:
  Dim oResponse 'As MeetingItem
  Set oResponse = oAppt.Respond(olMeetingAccepted, True)
  oResponse.Close (olSave)
  
  oRequest.UnRead = False
  oRequest.Delete
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
try oldiscard instead of olsave.

(I think cached mode is the cause - it syncs before all of the changes and gets confused.)
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S HTML to Plain Text Macro - Help Outlook VBA and Custom Forms 1
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
C Newbie needs help with Outlook Macro Outlook VBA and Custom Forms 3
A newb outlook macro help Outlook VBA and Custom Forms 1
A Help creating macro for conditional formatting settings Using Outlook 8
S Help macro Outlook VBA and Custom Forms 1
C Help with a Macro to move emails to a different PST data file Using Outlook 4
F Help with Outlook 2007 Macro Please! Using Outlook 4
R VBA Macro to VBScript in a form- Help Please! Using Outlook 10
S Outlook macro help Using Outlook 10
P Please Help me Create a Macro ! Using Outlook 2
D Help with simple macro - looping though all emails in my inbox Using Outlook 3
S Macro help Using Outlook 4
S Outlook 2003: Help with setting up a macro to reply to selected emails Using Outlook 2
M Help - VB Macro no longer work Outlook VBA and Custom Forms 5
S MAcro - Need help in getting the recipients in to filed / cc field toput in an array Outlook VBA and Custom Forms 4
L Help for writing an Outlook 2007 macro Outlook VBA and Custom Forms 7
V Outlook macro help please Outlook VBA and Custom Forms 23
e_a_g_l_e_p_i Has nobody used Office 2021 enough to help me or have you given up on me.......lol Using Outlook 1
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
L Help connecting to hosted exchange server 2016 Using Outlook 0
B Seeking help with Outlook rule Using Outlook 2
D Need help with MS Authenticator Using Outlook 4
I Outlook for Mac 2019 using on desktop and laptop IMAP on both need help with folders Using Outlook 1
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
S.Champ Please help? I've imported a random workcalendar I dont even know who's. Can I undo it? and then I need to re-sync the google one again. Its a mess:( Using Outlook 2
e_a_g_l_e_p_i Outlook 2010 Help setting up Gmail account in Outlook 2010 Using Outlook 3
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
F Microsoft Outlook Connector 14.0.6123.5001 - Help! Using Outlook 6
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
R Disable conversation thread from replying of recipients in the same subject. Please help Using Outlook 0
R seperate read layout to design in outlook 2016..Help!! Outlook VBA and Custom Forms 3
O Help .. got lost ... installing Office like 2016 Using Outlook 5
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
Marc2019 Need help please! Cannot Setup my outlook email account on my Mac Outlook 2011 Using Outlook.com accounts in Outlook 2
L Attachment saving and tracking - PLEASE help! Outlook VBA and Custom Forms 5
I Help with dates in task list. Using Outlook 5
C need help setting up outlook first time Using Outlook 1
K To do bar help Using Outlook 8
M Help sending email but removing signature via VBA Outlook VBA and Custom Forms 5
S help with outlook scripting Outlook VBA and Custom Forms 4
EmelineGueguen Help to understand the problem of work Using Outlook 1
N Outlook Forms Help Outlook VBA and Custom Forms 2
N Need help syncing contacts to iPhone X Using Outlook 8
broadbander Needing help with reply/reply all while keeping attachments and adding a new CC recipient. Outlook VBA and Custom Forms 5
J Help! My contacts have disappeared. Using Outlook 5

Similar threads

Top