Outlook voting button no response summary

Posted on 2007-09-30
Medium Priority
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
  • 4
  • 3
LVL 76

Accepted Solution

David Lee earned 2000 total points
ID: 19988486
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

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

Expert Comment

by:David Lee
ID: 19989719
Thanks and you're welcome!
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!


Author Comment

ID: 20078486
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
ID: 20082101
"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

ID: 20082902
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
ID: 20098100
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.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

839 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