Question : Automatically decline meeting request for a specific meeting on the calendar

I have been asked to find a solution in Outlook that allows someone to automatically decline a meeeting request for a specific meeting on his/her calendar. I know about the Tools-Options-Calendar Options-Advanced Options-Resource Scheduling trick to automatically decline conflicting meeting requests, but this only applies for ALL meetings on the calendar. Is there any kind of setting or programming possible in Outlook that does this for SPECIFIC meetings rather that the entire calendar?

Answer : Automatically decline meeting request for a specific meeting on the calendar

Here's the code for doing this.  Follow these instructions to use it.

For Outlook 2003 and earlier:

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of
5.  Outlook's VB Editor window
6.  Edit the code as needed.  I included comment lines wherever something needs to or can change
7.  Click the diskette icon on the toolbar to save the changes
8.  Close the VB Editor
9.  Click Tools->Macro->Security
10. Set the Security Level to Medium
11. Close Outlook
12. Start Outlook
13. Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

For Outlook 2007

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comment lines wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools > Trust Center
9.  Click Macro Security
10. Set Macro Security to "Warnings for all macros"
11. Click OK
12. Close Outlook
13. Start Outlook.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Private WithEvents olkInbox As Outlook.Items
 
Private Sub Application_Quit()
    Set olkInbox = Nothing
End Sub
 
Private Sub Application_Startup()
    Set olkInbox = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
 
Private Sub olkInbox_ItemAdd(ByVal Item As Object)
    Dim olkMeeting As Outlook.MeetingItem, _
        olkAppt As Outlook.AppointmentItem
    If Item.Class = olMeetingRequest Then
        Set olkAppt = Item.GetAssociatedAppointment(False)
        'Change the subject text on the next line'
        If Item.Subject = "Testing" Then
            Set olkMeeting = olkAppt.Respond(olMeetingDeclined, True)
            olkMeeting.Send
        End If
    End If
End Sub
Random Solutions  
 
programming4us programming4us