Outlook voting button no response summary

Posted on 2007-09-30
Last Modified: 2008-01-09
I asked a question that was very similar to this question before.  The ID of the old question was  ID: 22664290 and Blue Devil Fan helped me with it.  His reponse was exactly what I was looking for.

Our team used to use voting buttons as an acknowledgement that the email was read.  The emails were sent out to groups of people who needed to know about a change in the organization.  We kept the emails that were sent out and used the tracking tab as records that the people had acknowledged the change.  It took us about a year but we realized that this was ineffective because many people did not acknowlege.  Now we have over 100 emails with missing acknowledgements.

The emails would be sent out with the subject of the change as the subject line of the email.  What I am looking for is a macro that can summarize what the subject of the email was and who did not acklowedge.  We can then go back and find out who needs to perform a retroactive acknowledgement of the change.

We stored all the emails as .msg files in a specific directory.  Can someone please help with writing a macro that can search for voting button emails and create a summary of the subject lines and below each subject line create a list of those who did not acknoweledge?  If necessary I can send a few examples of these emails to someone if they need to play around to get it to work correctly.
Question by:browneye9000
    LVL 76

    Accepted Solution

    Hi, browneye9000.

    Try this.

    'This declaration must go at the top of the module.
    Private Declare Function ShellExecute Lib "shell32.dll" _
      Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
      ByVal lpFile As String, ByVal lpParameters As String, _
      ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    Sub CheckForVotes()
        Dim olkItem As Outlook.MailItem, _
            olkRecipient As Outlook.Recipient, _
            strFolder As String, _
            strFileName As String, _
            objFSO As Object, _
            objFile As Object
        'Change the folder path on the following line as needed
        strFolder = "C:\eeTesting\"
        strFileName = Dir(strFolder & "*.msg")
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        'Change the output filename and path as desired
        Set objFile = objFSO.CreateTextFile(strFolder & "No Responses.txt", True)
        Do Until strFileName = ""
            ShellExecute 0&, "open", strFolder & strFileName, 0&, 0&, 0&
            Do Until Application.Inspectors.Count = 1
            Set olkItem = Application.ActiveInspector.CurrentItem
            objFile.WriteLine "Message: " & olkItem.Subject
            For Each olkRecipient In olkItem.Recipients
                If olkRecipient.TrackingStatus <> olTrackingReplied Then
                    objFile.WriteLine "  - " & olkRecipient.Name
                End If
            olkItem.Close olDiscard
            strFileName = Dir
        Set objFile = Nothing
        Set objFSO = Nothing
        Set olkRecipient = Nothing
        Set olkItem = Nothing
    End Sub

    Author Comment

    Once again you have amazed me.  Thanks so much.  You've saved us hours of work!
    LVL 76

    Expert Comment

    by:David Lee
    Thanks and you're welcome!

    Author Comment

    Ran the macro and found out that it is pulling everyone on the voting list.  Not just those that have no response to the vote.  Also, if possible, I would also like to have the macro pull names that indicate the word "DELETED" beside it.  This indicates that the person never acknowledged the email but just deleted it.
    LVL 76

    Expert Comment

    by:David Lee
    "Ran the macro and found out that it is pulling everyone on the voting list"
    I've run the macro several times against voting messages I have and it always works correctly.  Did I misunderstand what you wanted to accomplish?  This macro is desgined to work only with messages that employed voting buttons.  The macro doesn't pay any attention to whether the message was read, it only checks to see if the recipient voted.  If they didn't vote, then they go on the list.

    Author Comment

    You are exactly right.  I tried to apply it to a different type of file that we had sent out.  Once I got my head out of my *@^# I realiized that I wasn't doing it correctly.  Sorry for bothering you.
    LVL 76

    Expert Comment

    by:David Lee
    No problem.  If you need another version that checks to see if messages were deleted without being read, then I can modify this code to do that.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
    Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now