jwright77
asked on
How to block meeting requests
Our CEO doesn't want to recieve meeting requests. Is there a way to block all requests. I have created a rule that deletes them but they still show up on his calendar.
Hi, jwright77.
I might be able to do it with a bit of scripting. Is that an option?
I might be able to do it with a bit of scripting. Is that an option?
ASKER
Sure.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the script. But I'm getting an runtime error 13 Type mismatch error in line 4.
On line 2 change
olkResp As Outlook.MailItem
to
olkResp As Object
olkResp As Outlook.MailItem
to
olkResp As Object
ASKER
BlueDevilFan,
Thanks for your help. But the code is not working. It doesn't appear to do anything. I attached the code as I have it below.
Thanks
Thanks for your help. But the code is not working. It doesn't appear to do anything. I attached the code as I have it below.
Thanks
Sub IgnoreMeetingRequests(Item As Outlook.MeetingItem)
Dim olkAppt As Outlook.AppointmentItem, olkResp As Object
Set olkAppt = Item.GetAssociatedAppointment(True)
Set olkResp = olkAppt.Respond(olMeetingDeclined, True)
olkResp.Send
Item.Delete
Set olkAppt = Nothing
Set olkResp = Nothing
End Sub
I tested the code before posting, so I know it works. Did you follow all of the instructions I posted exactly? Can you post a screen shot showing the rule you created for running this?
ASKER
Ok. Replace the code with the version below and test again. I added a command to display a popup message if the code fires. The first step is to determine if the code is running at all.
Sub IgnoreMeetingRequests(Item As Outlook.MeetingItem)
Dim olkAppt As Outlook.AppointmentItem, olkResp As Object
MsgBox "IgnoreMeetingRequests Fired"
Set olkAppt = Item.GetAssociatedAppointment(True)
Set olkResp = olkAppt.Respond(olMeetingDeclined, True)
olkResp.Send
Item.Delete
Set olkAppt = Nothing
Set olkResp = Nothing
End Sub
ASKER
It does not fire. I checked the security under Tools--macros--security and it is set to low.
Thanks
Thanks
This happens sometimes. Add the code below to the ThisOutlookSession module. Close and restart Outlook. You should get a warning about macros and be asked if you want to enable them. Say yes. Try the original code again.
Private Sub Application_Startup()
MsgBox "Macros enabled"
End Sub
Sorry, but I have to object. The solution I posted does work and does do exactly what the question author asked for.
I certainly haven't seen any way.
The only thing I can think of is to use Delegates to send the requests to someone else, but those will still appear on the calendar as tentative until the delegate declines them.
Simon.