Exporting Meeting 'Accepted'

I have a meeting on calendar sent companywide (thousands) that reads '540 attendees accepted, 12 tentatively accepted, and 1941 declined.'

I would like to export a list of just the 'attendees accepted'

Any way to do this?
LVL 20
RPPreacherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Serena HsiMarketing ConsultantCommented:
http://www.outlookcode.com/codedetail.aspx?id=37

Sub PrintAapptAttendee()
'  Gather data from an opened appointment and print to
'  Word.  This provides a way to print the attendee list with their
'  response, which Outlook will not do on its own.

' Set up Outlook
Dim objApp As Outlook.Application
Dim objItem As Object
Dim objSelection As Selection
Dim objAttendees As Outlook.Recipients
Dim objAttendeeReq As String
Dim objAttendeeOpt As String
Dim objOrganizer As String
Dim dtStart As Date
Dim dtEnd As Date
Dim strSubject As String
Dim strLocation As String
Dim strNotes As String
Dim strMeetStatus As String
Dim strUnderline As String ' Horizontal divider line

' Set up Word
Dim objWord As Word.Application
Dim objdoc As Word.Document
Dim wordRng As Word.Range
Dim wordPara As Word.Paragraph

On Error Resume Next

Set objApp = CreateObject("Outlook.Application")
Set objItem = objApp.ActiveInspector.CurrentItem
Set objSelection = objApp.ActiveExplorer.Selection
Set objAttendees = objItem.Recipients

Set objWord = GetObject(, "Word.application")
If objWord Is Nothing Then
 Set objWord = CreateObject("word.application")
End If

strUnderline = String(60, "_") ' use 60 underline characters

On Error GoTo EndClean:

' check for user problems with none or too many items open
Select Case objSelection.Count
    Case 0
      MsgBox "No appointment was opened.  Please opten the appointment to print."
      GoTo EndClean:
    Case Is > 1
      MsgBox "Too many items were selected.  Just select one!!!"
      GoTo EndClean:
End Select

' Is it an appointment
If objItem.Class <> 26 Then
  MsgBox "You First Need To open The Appointment to Print."
  GoTo EndClean:
End If

' Get the data
dtStart = objItem.Start
dtEnd = objItem.End
strSubject = objItem.Subject
strLocation = objItem.Location
strNotes = objItem.Body
objOrganizer = objItem.Organizer
objAttendeeReq = ""
objAttendeeOpt = ""

' Get The Attendee List
For x = 1 To objAttendees.Count
   strMeetStatus = ""
   Select Case objAttendees(x).MeetingResponseStatus
     Case 0
       strMeetStatus = "No Response (or Organizer)"
     Case 1
       strMeetStatus = "Organizer"
     Case 2
       strMeetStatus = "Tentative"
     Case 3
       strMeetStatus = "Accepted"
     Case 4
       strMeetStatus = "Declined"
   End Select
 
   If objAttendees(x).Type = olRequired Then
      objAttendeeReq = objAttendeeReq & objAttendees(x).Name & vbTab & strMeetStatus & vbCr
   Else
      objAttendeeOpt = objAttendeeOpt & objAttendees(x).Name & vbTab & strMeetStatus & vbCr
   End If
Next
 
' Word: Open a new doc and stuff it

objWord.Visible = True
Set objdoc = objWord.Documents.Add
Set objdoc = objWord.ActiveDocument
Set wordRng = objdoc.Range

With wordRng
    .Font.Bold = True
    .Font.Italic = False
    .Font.Size = 14
    .InsertAfter "Organizer: " & objOrganizer
    .InsertParagraphAfter
    .InsertAfter strUnderline
    .InsertParagraphAfter
    .InsertParagraphAfter
End With

Set wordPara = wordRng.Paragraphs(4)
With wordPara.Range
    .Font.Bold = False
    .Font.Italic = False
    .Font.Size = 12
    .InsertAfter "Subject:  " & strSubject
    .InsertParagraphAfter
    .InsertAfter "Location: " & strLocation
    .InsertParagraphAfter
    .InsertParagraphAfter
    .InsertAfter "Start:    " & dtStart
    .InsertParagraphAfter
    .InsertAfter "End:     " & dtEnd
    .InsertParagraphAfter
    .InsertParagraphAfter
    .InsertAfter "Required: "
    .InsertParagraphAfter
    .InsertAfter objAttendeeReq
    .InsertParagraphAfter
    .InsertAfter "Optional: "
    .InsertParagraphAfter
    .InsertAfter objAttendeeOpt
    .InsertParagraphAfter
    .InsertAfter strUnderline
    .InsertParagraphAfter
    .InsertAfter "NOTES"
    .InsertParagraphAfter
    .InsertAfter strNotes
End With
 
EndClean:
Set objApp = Nothing
Set objItem = Nothing
Set objSelection = Nothing
Set objAttendees = Nothing
Set objWord = Nothing
Set objdoc = Nothing
Set wordRng = Nothing
Set wordPara = Nothing

End Sub

If the macro errors on the "Dim objWord As Word.Application" line, add the Microsoft Word library to your project. This is under Tools / References.
0
RPPreacherAuthor Commented:
"Compile error:  User-defined type not defined"
At 'Dim objApp As Outlook.Application'

Tools > References Grayed Out
0
David LeeCommented:
Hi RPPreacher,

Here's another slightly different approach.  Follow these instructions 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 desired.  I placed a comment line on the line above where somethings nneds to be changed.
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.  Select (click on) an appointment.
11.  Run the macro (Tools->Macro->Macros).  It produces a text file you can print from Notepad or any program that handles text files.

Sub MeetingResponseStatus()
    Dim olkAppointment As Outlook.AppointmentItem, _
        olkRecipient As Outlook.Recipient, _
        objFSO As Object, _
        objFile As Object
    Set olkAppointment = Application.ActiveExplorer.Selection(1)
    If olkAppointment.Class = olAppointment Then
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        'Change the file name and path as desired
        Set objFile = objFSO.CreateTextFile("C:\eeTesting\Attendees.txt")
        objFile.WriteLine "Meeting: " & olkAppointment.Subject
        objFile.WriteLine " Starts: " & olkAppointment.Start
        objFile.WriteLine ""
        objFile.WriteLine "The following staff accepted the meeting request"
        objFile.WriteLine ""
        For Each olkRecipient In olkAppointment.Recipients
            If olkRecipient.MeetingResponseStatus = olResponseAccepted Then
                objFile.WriteLine olkRecipient.Name
            End If
        Next
    End If
    objFile.Close
    Set objFile = Nothing
    Set objFSO = Nothing
    Set olkRecipient = Nothing
    Set olkAppointment = Nothing
    MsgBox "All done!"
End Sub

Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RPPreacherAuthor Commented:
SWEEEEEEEEETTTTTT!!!!!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.

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.