Link to home
Start Free TrialLog in
Avatar of 4eyesgirl
4eyesgirl

asked on

Extract Meeting Attendance data of meeting rooms from Exchange 2003/2007

We have a need to analyze meeting utilization, by comparing the number of attendee to the room capacity.  Is there a way to pull this data programmically from Exchange for all meeting rooms?

Avatar of David Lee
David Lee
Flag of United States of America image

Hi, 4eyesgirl.

I might be able to do this with a bot of scripting.  Is that an option?  
Avatar of 4eyesgirl
4eyesgirl

ASKER

Sure.  scripting is fine.
what type of scripting? vb script?

thanks!
VBA not VBScript.  There's a slight difference in syntax and capability, but the big difference is that VBScript runs from outside Outlook while VBA runs from inside.  Here's the code for doing this.  Follow these instrcutions to use it.

1.  Start Outlook.
2.  Click Tools > Macro > Visual Basic Editor.
3.  If not already expanded, expand Modules and click on Module1.
4.  Copy the code below and paste it into the right-hand pane of the VB Editor.
5.  Edit the code as needed.  I placed comment lines where things need to change.
6.  Click the diskette icon on the toolbar to save the changes.
7.  Close the VB Editor.
8.  Click Tools->Macro->Security.
9.  Change the Security Level setting to Medium.
10.  Run the macro.  It produces an HTML file listing all meetings, the date the meeting occurs on, and the sum of attendees who have accepted or tentatively accepted.
Sub CountAttendees()
    Dim olkItems As Object, olkAppt As Object, olkAttendee As Object, objFSO Object, objFile As Object, intAttendees As Integer
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    'Change the file name and path on the next line as desired.'
    Set objFile = objFSO.CreateTextFile("C:\eeTesting\Appointments.html")
    objFile.WriteLine "<table>"
    Set olkItems = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar).Items
    olkItems.Sort "[Start]"
    olkItems.IncludeRecurrences = True
    'Change the dates/times on the next line as desired.'
    Set olkItems = olkItems.Restrict("[Start] >= '" & Format("1/1/2008 12:01am", "ddddd h:nn AMPM") & "' AND [Start] <= '" & Format("12/31/2008 11:59pm", "ddddd h:nn AMPM") & "'")
    For Each olkAppt In olkItems
        Debug.Print olkAppt.Subject
        If olkAppt.MeetingStatus = olMeeting Then
            intAttendees = 0
            For Each olkAttendee In olkAppt.Recipients
                Select Case olkAttendee.MeetingResponseStatus
                    Case olResponseAccepted, olResponseTentative
                        intAttendees = intAttendees + 1
                End Select
            Next
            objFile.WriteLine "<tr><td>" & olkAppt.Subject & "</td><td>" & olkAppt.Start & "</td><td>" & intAttendees & "</td></tr>"
        End If
        DoEvents
    Next
    objFile.WriteLine "</table>"
    objFile.Close
    Set objFile = Nothing '
    Set objFSO = Nothing
    Set olkAttendee = Nothing
    Set olkAppt = Nothing
    Set olkItems = Nothing
    MsgBox "Done"
End Sub

Open in new window

This cool! However, it seems only pull meetings I am access to.  How do I extract all meetings which includes meetings I did not get a invite for?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial