easiest way to make an appointment for me + one of 8 rooms

I'm using Outlook 2007. I'm trying to come up with an easy way to book an appointment for me + one of 8 rooms.

If I make a Group Schedule for me + the 8 meeting rooms, the scheduler tries to find a way to find a time when me + all 8 of the meeting rooms are available. I want a time when me and any one of the 8 rooms is available (the rooms are all the same).

What would people recommend as a good way to teach people how to do this?

If someone has an idea about a macro that could do it, I could go that way if necessary (I'm an experienced VBA programmer).
LVL 4
GordonPrinceAsked:
Who is Participating?
 
David LeeCommented:
This appears to work properly.  You should test it with a few appointments to make sure though.  Follow these instructions to add the code to Outlook.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  If not already expanded, expand Modules
5.  Select an existing module (e.g. Module1) by double-clicking on it or create a new module by right-clicking Modules and selecting Insert > Module.
6.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Edit the code as needed.  I included comments wherever something needs to or can change
8.  Click the diskette icon on the toolbar to save the changes
9.  Close the VB Editor

To use this solution

1.  Create an appointment
2.  Fill in the starting and ending times
3.  Run the macro FindConferenceRoom (You can add a button to the QAT that runs the code.)

This macro works by searching the list of conference rooms for one that's free.  It does this by retrieving the free and busy information for each room using the duration of your meeting as the interval.  The information returned is a character string where each character equals one interval (e.g. if the appointment is 30 minutes long, then each character equals 30 minutes).  The code then calculates which intervals to check and looks at them to see if the room is free.  If the interval has a 0 in it, then the room is free.  If it has a 1, then it isn't.  If the code determines the room is free for all the required intervals, then it adds the room to the appointment.  If instead the code determines that the room is not free, then it skips to the next room.  If all eight rooms are free, then the code will always book the first room in the list.  

I tested this on my system with a few different meeting lengths (e.g. 30 minutes, 45 minutes, 1 hour) and it always picked a free room.
Sub FindConferenceRoom()
    Const CONF_RM_LIST = "IR1,IR2,IR3,IR4,IR5,IR6,IR7,IR8"
    Dim olkAppt As Outlook.AppointmentItem, _
        olkRcp As Outlook.Recipient, _
        olkRoom As Outlook.Recipient, _
        arrRooms As Variant, _
        varRoom As Variant, _
        strFB As String, _
        intStart As Integer, _
        intEnd As Integer, _
        intIdx As Integer, _
        bolFree As Boolean
    arrRooms = Split(CONF_RM_LIST, ",")
    Set olkAppt = Application.ActiveInspector.CurrentItem
    intStart = CalculateInterval(olkAppt.Start, olkAppt.Duration, True)
    intEnd = CalculateInterval(olkAppt.End, olkAppt.Duration, False)
    For Each varRoom In arrRooms
        bolFree = True
        Set olkRcp = Session.CreateRecipient(varRoom)
        strFB = olkRcp.FreeBusy(olkAppt.Start, olkAppt.Duration, False)
        For intIdx = intStart To intEnd
            If Mid(strFB, intIdx, 1) = 1 Then
                bolFree = False
                Exit For
            End If
        Next
        If bolFree Then
            Set olkRoom = olkAppt.Recipients.Add(varRoom)
            olkRoom.Type = olResource
            Exit For
        End If
    Next
    Set olkAppt = Nothing
    Set olkRcp = Nothing
End Sub

Function CalculateInterval(datStart As Date, intDuration As Integer, bolStart As Boolean) As Integer
    Dim intMinutes As Integer
    intMinutes = (Hour(datStart) * 60) + Minute(datStart)
    If bolStart Then
        CalculateInterval = Int(intMinutes / intDuration) + 1
    Else
        CalculateInterval = Int(intMinutes / intDuration)
        Select Case intDuration
            Case Is <= 60
                If 60 Mod intDuration = 0 Then
                    CalculateInterval = CalculateInterval + 0
                Else
                    CalculateInterval = CalculateInterval + 1
                End If
            Case Is > 60
                If intDuration Mod 60 = 0 Then
                    CalculateInterval = CalculateInterval + 0
                Else
                    CalculateInterval = CalculateInterval + 1
                End If
            End Select
        End If
End Function

Open in new window

0
 
pdoelleCommented:
I can do this in Outlook 2003 as follows:

1) Create a new Meeting Request, and add all of the attendees in the To: field, and all of the rooms in the Resources: field.
2) Click on the Scheduling tab, and under the Options button, select AutoPick > Required People and One Resource.
3) Click the AutoPick Next or Previous button to locate the appropriate time slot. Only one of the free resources (rooms) will be selected, and the others will be automatically disabled/excluded from the invite.
0
 
David LeeCommented:
Hi, GordonPrice.

It's been awhile.  Hope you're doing well.

I think I can do what you want in a macro.  Armed with the names of the rooms and a starting and ending time a macro can search for the first room that's free and add it to the appointment.  Is that what you had in mind?  
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
GordonPrinceAuthor Commented:
BlueDevilFan: The macro seems like the way to go, if you can think of something that would work.

Needs to become a button on the Outlook toolbar that offers next available appointment for me + one of the 8 rooms. A display would be nice, but a pop-up with the date/time would be adequate to start with.
If the user answers vbYes then book meeting in the room,
vbNo = show me the next availability,
vbCancel = stop showing me the choices.

My rooms are IR1, IR2, IR3... IR8.

I've worked with Recipient.FreeBusy recently, so that's one option. But if there's something that could be stitched together in a macro, I'd like to consider that, too.

Any ideas greatly appreciated.
0
 
David LeeCommented:
I haven't forgotten about this question.  I should have something today.
0
 
GordonPrinceAuthor Commented:
This is excellent. Thanks.
0
 
David LeeCommented:
Thanks and you're welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.