Outlook 이메일에서 Excel 워크 시트로 투표 통계를 빠르게 내보내는 방법

지금 공유 :

If you have sent an email with voting buttons, after recipients send you their replies, you may want to count and export the voting statistics to an Excel worksheet. So, in this post, we will teach you how to achieve it swiftly.

Outlook은 매우 강력하여 "투표"기능도 제공합니다. 내 이전 기사“투표를위한 MS Outlook의 능숙한 사용” has taught how to utilize it effectively. Also, most of time, after voting, you may proceed to export the voting statistics to an Excel worksheet for some reasons, such as wish to print out the statistics. But Outlook doesn’t support this by default. Thus, in the followings, we will teach you how to realize this like a cork.

Outlook 이메일에서 Excel 워크 시트로 투표 통계를 빠르게 내보내기

이메일의 투표 통계를 Excel 워크 시트로 내보내기

  1. 처음에는 Outlook 응용 프로그램을 시작하십시오.
  2. 그런 다음 기본 Outlook 창에서 "Alt + F11"키 버튼을 눌러야합니다.
  3. Next in the “Microsoft Visual Basic for Applications” window,  you should enable “Microsoft Excel Object Library”. Click “Tools” > “Reference”. Then in the popup dialog box, mark the checkbox in front of the “Microsoft Excel Object Library” and hit “OK” lastly.
  4. 그런 다음 새 모듈을 삽입하거나 사용하지 않는 모듈을 열 수 있습니다.
  5. 그런 다음 다음 VBA 코드를 복사하여이 모듈에 붙여 넣습니다.
Sub ExportVotingStatistics _Excel ()
    Dim objMail As Outlook.MailItem
    Dim objRecipient As Outlook.recipient
    Dim objVoteDictionary As Object
    Dim varVotingCounts As Variant
    Dim varVotingOptions As Variant
    Dim varVotingOption As Variant
    Dim i As Long
    Dim objExcelApp As Excel.Application
    Dim objExcelWorkbook As Excel.Workbook
    Dim objExcelWorksheet As Excel.Worksheet
    Dim nRow As Integer
 
    Set objMail = Application.ActiveExplorer.Selection(1)
 
    'Create a new excel worksheet
    Set objExcelApp = CreateObject("Excel.Application")
    Set objExcelWorkbook = objExcelApp.Workbooks.Add
    Set objExcelWorksheet = objExcelWorkbook.Sheets(1)
 
    'Fill in the predefined values
    With objExcelWorksheet
         .Cells.Font.Name = "Cambria"
         .Cells(1, 1) = "Voting Results for Email:"
         .Cells(1, 2) = Chr(34) & objMail.Subject & Chr(34)
         .Cells(3, 1) = "Voting Options"
         .Cells(3, 2) = "Voting Counts"
    End With
 
    Set objVoteDictionary = CreateObject("Scripting.Dictionary")
    'get the default voting options
    varVotingOptions = Split(objMail.VotingOptions, ";")
    'Add the voting responses to the dictionary
    For Each varVotingOption In varVotingOptions
        objVoteDictionary.Add varVotingOption, 0
    Next
    'Add a custom voting response - "No Reply"
    objVoteDictionary.Add "No Reply", 0
 
    'Process the all voting responses
    For Each objRecipient In objMail.Recipients
        If objRecipient.TrackingStatus = olTrackingReplied Then
           If objVoteDictionary.Exists(objRecipient.AutoResponse) Then
              objVoteDictionary.Item(objRecipient.AutoResponse) = objVoteDictionary.Item(objRecipient.AutoResponse) + 1
           Else
              objVoteDictionary.Add objRecipient.AutoResponse, 1
           End If
        Else
           objVoteDictionary.Item("No Reply") = objVoteDictionary.Item("No Reply") + 1
        End If
    Next
 
    'Get the voting options and vote counts
    varVotingOptions = objVoteDictionary.Keys
    varVotingCounts = objVoteDictionary.Items
 
    'Fill in the values in specific cells
    nRow = 4
    For i = LBound(varVotingOptions) To UBound(varVotingOptions)
        With objExcelWorksheet
             .Cells(nRow, 1) = varVotingOptions(i)
             .Cells(nRow, 2) = varVotingCounts(i)
        End With
        nRow = nRow + 1
    Next
 
    'Save the new Excel file
    objExcelWorksheet.Columns("A:B").AutoFit
    strExcelFile = "E:\Voting Results " & Format(Now, "YYYY-MM-DD hh-mm-ss") & ".xlsx"
    objExcelWorkbook.Close True, strExcelFile

    MsgBox "Complete!", vbExclamation
End Sub

VBA 코드-Outlook 전자 메일에서 Excel 워크 시트로 투표 통계 내보내기

  1. 그 후 편리한 액세스를 위해 빠른 액세스 도구 모음에 새 매크로를 추가하는 것이 좋습니다.
  2. 결국 시도해 볼 수 있습니다.
  • 먼저 투표 버튼이 포함 된 소스 이메일을 선택합니다.
  • 그런 다음 빠른 실행 도구 모음에서 매크로 버튼을 클릭합니다.
  • 이 매크로 실행이 완료되면 미리 정의 된 로컬 폴더로 이동하여 새 Excel 통합 문서를 볼 수 있습니다.
  • 이 Excel 통합 문서를 엽니 다. 이제 아래 이미지와 같이 투표 통계가 표시됩니다.내 보낸 투표 통계

아무도 Outlook 오류를 철저히 피할 수 없습니다

Outlook에는 다양한 기능이 제공되지만 Outlook 오류를 방지하는 데 도움이되는 기능은 없습니다. 모든 종류의 요인으로 인해 Outlook 오류가 발생할 수 있습니다. 예를 들어 Outlook을 부적절하게 자주 종료하면 문제가 발생할 수 있습니다. PST 손상. 이러한 시나리오에서는 다음과 같은 PST 파일을 구하기 위해 강력한 도구를 사용할 수밖에 없습니다. DataNumen Outlook Repair. 높은 회복률로 인해 많은 명성을 얻었습니다.

저자 소개 :

Shirley Zhang은 데이터 복구 전문가입니다. DataNumen, Inc.는 다음과 같은 데이터 복구 기술 분야의 세계적 리더입니다. 손상된 mdf 및 전망 수리 소프트웨어 제품. 자세한 내용은 WWW.datanumen.COM

지금 공유 :

댓글이 닫혀있다.