How to Quickly Send Voting Statistics of an Outlook Email to Original Recipients

After you sent an email with voting buttons to multiple recipients and have received their voting responses, if you wish to send the voting statistics to the recipients, you can use the way introduced in this article. It can help you realize it just by one click.

Have you ever utilized “Voting Buttons” feature in your Outlook? You can send an email with “voting buttons” to many recipients and receive the voting responses from them. Now, if all the recipients have sent back their voting responses and you want to send the voting statistics to them, you can use the following method, which can let you accomplish this task in a jiffy.

Send Voting Statistics of an Email to Original Recipients

  1. At the outset, press “Alt + F11” key buttons in Outlook.
  2. Then, in the new window, enable the “MS Word Object Library” by referring to “How to Add an Object Library Reference in VBA“.
  3. Next, copy the VBA code below into a module.
Sub SendVotingStatistics_OriginalRecipients()
    Dim objMail As Outlook.MailItem
    Dim objRecipient As Outlook.Recipient
    Dim objDictionary As Object
    Dim varVotingCounts As Variant
    Dim varVotingOptions As Variant
    Dim varVotingOption As Variant
    Dim objNewMail As Outlook.MailItem
    Dim i As Long
    Dim strVotingStatistics As String
    Dim objMailDocument As Word.Document
 
    'Get the source email
    Set objMail = Application.ActiveExplorer.Selection(1)
 
    'Collect Voting Options
    Set objDictionary = CreateObject("Scripting.Dictionary")
    varVotingOptions = Split(objMail.VotingOptions, ";")
    For Each varVotingOption In varVotingOptions
        objDictionary.Add varVotingOption, 0
    Next
    objDictionary.Add "No Reply", 0
 
    'Get Voting Statistics
    For Each objRecipient In objMail.Recipients
        If objRecipient.TrackingStatus = olTrackingReplied Then
           If objDictionary.Exists(objRecipient.AutoResponse) Then
              objDictionary.Item(objRecipient.AutoResponse) = objDictionary.Item(objRecipient.AutoResponse) + 1
           Else
              objDictionary.Add objRecipient.AutoResponse, 1
           End If
        Else
           objDictionary.Item("No Reply") = objDictionary.Item("No Reply") + 1
        End If
    Next
   
    varVotingOptions = objDictionary.Keys
    varVotingCounts = objDictionary.Items
 
    'Add the Voting Statistics to "Reply All" Mail
    Set objNewMail = objMail.ReplyAll
    objNewMail.Display
 
    For i = LBound(varVotingOptions) To UBound(varVotingOptions)
        strVotingStatistics = strVotingStatistics & varVotingOptions(i) & ": " & varVotingCounts(i) & vbCr
    Next
 
    Set objMailDocument = objNewMail.GetInspector.WordEditor
    objMailDocument.Range(0, 0).InsertAfter "This is the voting statistics:" & vbCrLf & strVotingStatistics
End Sub

VBA Code - Send Voting Statistics in an Email to Original Recipients

  1. After that, add this macro to Quick Access Toolbar with accordance to “How to Run VBA Code in Your Outlook“.
  2. Finally, just try this macro by the following steps.
  • First of all, select the source email.
  • Then, click the macro button in Quick Access Toolbar.
  • At once, a new mail will be displayed, as shown in figure below. As you can see, the voting statistics have been in the message body. And original recipients have been added.Inserted Voting Statistics in Mail
  • Now, you can click “Send” button to send it out.

Salvage Your Outlook Data

In the event of seriously damaged Outlook file, what can you do to get back your valuable Outlook data? Generally speaking, you can firstly try the inbuilt fix tool – Scanpst to repair your file. However, most of time, it’ll fail in that severe Outlook damage has exceeded what it can do. At that time, your unique resort is a more potent repair tool, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and outlook repair software products. For more information visit www.datanumen.com