- Community Pick
- Experts Exchange Approved
I can’t answer Brian’s question on why Microsoft hasn’t included this feature. What I can do is offer Brian a workaround. I’m not going to call it a solution because it’s imperfect. The workaround is to use a script to detect when Brian adds a meeting to his calendar and give him the opportunity to block-off travel time on either side of it. Here’s how it works.
1. Brian creates or accepts a meeting.
2. The script detects the fact that a meeting has been added to his calendar.
3. The script displays a dialog-box asking Brian if he wants to schedule travel time for this appointment.
4. If Brian answers “yes”, then the script prompts him for the number of minutes of travel.
5. Brian enters the number of minutes.
6. The script creates two appointments, one on either side of the meeting. Each of these appointments blocks off the number of minutes Brian entered in step #5.
Using the example Brian gave in his tweet, if he created a meeting that ran from 1:15 to 2:15, then the script would create an appointment from 1:00 – 1:15 for Brian to travel to the meeting and another from 2:15 – 2:30 for Brian to return from the meeting.
As I noted earlier this isn’t a complete solution because it’s not perfect. In this context “not perfect” means that it doesn’t handle everything it needs to. If the meeting time changes, then Brian will have to manually deal with the two travel appointments. Ditto if the meeting is canceled. The workaround doesn’t handle different travel times either. Brian may be able to get to the meeting in 15 minutes, but he may know that at 2:15 it’ll take him 30 minutes to get back. Or perhaps this is the last meeting of the day and Brian won’t be returning and therefore doesn’t need to block travel time after the meeting. A true solution would handle all of these issues.
Here’s the code that Brian will need to use the workaround.
One quick note on the code: it only works against meetings, not appointments. In the Outlook context a meeting involves others whereas an appointment only involves you. If you want the code to work for appointments, then remove lines 16 and 42.
Here’s how to add the code to Outlook.
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.
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.
I hope Brian finds this useful!
Note: This is a repost of a posting I created on my external blog.
by: mwvisa1 on 2010-07-21 at 15:20:47ID: 17320
Love the article and think I will make good use of this new tool. In fact right after loading this, I had to enter a dental appointment which is an appointment since no one else is invited and is important for me to know the time of actual appointment but requires I block my calendar to allow travel time from office to dentist. To take advantage of your tip as well as your note on usinging this for both appointments and meetings, here is my version.
Added Sub Routine:
Select allOpen in new window
Note I moved constant SCRIPT_NAME to a global variable:
Select allOpen in new window
Updated olkCalendar_ItemAdd:
Select allOpen in new window
For me, I only wanted this prompt on "Out Of Office" meetings or appointments which also prevented the prompting of travel time for the travel time as you had already set those to have a BUSY status in your code. I also like to give myself a few extra minutes (to be early), so added 5 minutes buffer between travel time and actual meetings in my version. Additioanlly, using two calls for creating appointments, I take advantage of your code which will NOT create an entry for 0 minute travel time, so I get to easily choose when I only want travel time to or from a meeting.
Again thanks and you have a YES from me above!
Best regards,
mwvisa1