Creating Outlook Meetings that end early.
Here are the instructions to create a macro that will allow you create Outlook 2010 meetings that are scheduled to end 15 minutes shorter than the selected time.
First, we need to enable the Outlook Developer toolbar:
- In Outlook, select the File | Options menu
- Select “Customize Ribbon”
- Then on the right, check the Developer option under Main Tabs
- Click on the “OK” button to close the Outlook Options window.
- Select the Developer tab
- Select Macros | Macros menu item in the ribbon bar.
- In the resulting dialog, enter “CreateCustomApp” in the Macro Name: field
- Click on the Create button
- Copy and paste the following code into the Microsoft Visual Basic for Application (MS VBA) window that appears, overwriting the existing empty Sub CreateCustomAppt() code that is there
Sub CreateCustomAppt() Const minShort = 15 Dim objOL 'As Outlook.Application Dim objAppt 'As Outlook.AppointmentItem Dim oView As Outlook.View Dim oExpl As Outlook.Explorer Dim oFolder As Outlook.Folder Dim oCalView As Outlook.CalendarView Const olAppointmentItem = 1 Const olMeeting = 1 Set objOL = CreateObject("Outlook.Application") Set objAppt = objOL.CreateItem(olAppointmentItem) Set oExpl = Application.ActiveExplorer Set oFolder = Application.ActiveExplorer.CurrentFolder Set oView = oExpl.CurrentView ' Check whether the active explorer is displaying a calendar view. If oView.ViewType = olCalendarView Then Set oCalView = oExpl.CurrentView With objAppt .Subject = "<Placeholder>" .Start = oCalView.SelectedStartTime '.Duration = 55 .End = DateAdd("n", -minShort, oCalView.SelectedEndTime) .ReminderMinutesBeforeStart = 15 .ReminderSet = True '.Save .Display End With End If Set objAppt = Nothing Set objOL = Nothing End Sub
- Save and close down the MS VBA window.
- Select File | Options menu from Outlook again
- Select the Customize Ribbon
- From the “choose commands from:” dropdown on the left side of the window, select “Macros” (you should see your CreateCustomApp macro there)
- On the right, the Customize the Ribbon should have “Main Tabs” already selected
- Highlight the “Home (Calendar)” item below the Main Tabs title
- Click on New Group ( a “New Group (Custom)” is created)
- Click on Rename… button.
- Let’s rename it to Custom and select any symbol you want.
- Click on the “OK” button to save your changes.
You should see the name change, and your Custom tab highlighted on the right list of tabs. We are now going to add the Macro we just created to our Custom Tab group.
- Click on the CreateCustomAppt macro listed on the left of the Outlook Options window to select it.
- Click on the “Add>>” button in the middle. This will add the a button for the macro in the selected (in this case our “Custom”) tab
- Click on the “Rename…” button.
- Name the button “Custom Appointment” and select an icon you like.
- Click on the “OK” button to save and close the Rename window.
- Click on the “OK” button to close the Outlook Options window
- Select the “Home” tab at the top of the Outlook application, and you should see your Custom Appointment icon in the ribbon bar.
Now to use the macro, find a date & time where you want to create your appointment. Select the range, let’s say “tomorrow from 4pm – 5pm”. Now click the Custom Appointment button in the ribbon bar, and an appointment dialog will appear with a meeting created that is 15 minutes shorter than the selected time.
That’s it. If you want sometime other than 15 minutes less, then you can change the following line in the macro:
Const minShort = 15
to the number of minutes you want to “shorten” the meeting by.