Help with macro to answer and delete calendar requests?

Status
Not open for further replies.

EdNerd

Member
Outlook version
Outlook 2007
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
Outlook 2007
Email Account
Exchange Server
1. to save with no response sent use oResponse.Close (olSave).
Okay - I commented out .Display and inserted .Close -- thank you!!
2. oResponse is what you send back, oRequest is the message in your inbox.
3. Same for .delete.
D'oh!! Of course! :8>\

Thanks for the boost.
Ed
 

EdNerd

Member
Outlook version
Outlook 2007
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
Outlook 2007
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.
Thread starter Similar threads Forum Replies Date
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
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
J HELP- Rule to auto strip prepend from external emails Using Outlook 0
J Help Needed With Multi-Step Login Email Address Using Outlook.com accounts in Outlook 1
G Bcc help - Preventing multiple forwards from a bcc'd distribution group Using Outlook 1
G [Help] Converting array to destination folder path Outlook VBA and Custom Forms 1
K Help.... Office Outlook 2016 Using Outlook 1
S Error using AddressEntry.GetContact - need help Outlook VBA and Custom Forms 2
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
EaglePI Outlook 2010 need help with rules Using Outlook 0
B HELP! Using Outlook 4
Jeff Davis Help fix my Outlook 2013? Using Outlook 28
M Winmail. dat - HELP Using Outlook 2
Diane Poremsky Help! My Contacts are being updated! New Slipstick.com Articles 0
B VBA Help Email that will save as draft and send as attachment Outlook VBA and Custom Forms 3
J Can Anyone Help?? Outlook VBA and Custom Forms 1
B Need Help - Willing to pay Outlook VBA and Custom Forms 10
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
Similar threads


















































Top