If you would like to count the emails by sender, you can refer to this article. Here we will expose 2 quick approaches to you.
So as to know the most active sender for you, you may want to count the emails by sender. Although Outlook doesn’t provide a direct feature for this, you still can seek some workarounds, such as the following Method 1. If you think the Method 1 is too tedious, you can opt for the Method 2. It is much more effective in that it uses VBA to quickly count emails by sender and export the counts to Excel. Now read on to the two ways in detail. Here we’ll take emails in Inbox for an example.
Method 1: Get Counts after Grouping Items by “From” Field
- To begin with, launch Outlook application.
- Then, open the inbox folder.
- Next, switch to “View” tab.
- Subsequently, choose “From” in the “Arrangement” group.
- At once, all the inbox items have been separated into different groups as per the different senders.
- Now, to count the items from a specific sender, you can select all items in the related group and press “Enter” key. In the popup warning, you can see the count.
This means is quite easy, but the item counts actually include the other types of items, like meeting invitations, task requests and receipts, not only email counts. Thus, if you only want to count emails, you can use the following way instead.
Method 2: Count Emails by Sender with Outlook VBA
- For a start, press “Alt + F11” key buttons in Outlook.
- Then, enable “MS Excel Object Library” according to “How to Add an Object Library Reference in VBA“.
- Next, copy the code below into an unused module.
Sub CountInboxEmailsbySender() Dim objDictionary As Object Dim objInbox As Outlook.Folder Dim i As Long Dim objMail As Outlook.MailItem Dim strSender As String Dim objExcelApp As Excel.Application Dim objExcelWorkbook As Excel.Workbook Dim objExcelWorksheet As Excel.Worksheet Dim varSenders As Variant Dim varItemCounts As Variant Dim nLastRow As Integer Set objDictionary = CreateObject("Scripting.Dictionary") Set objInbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox) For i = objInbox.Items.Count To 1 Step -1 If objInbox.Items(i).Class = olMail Then Set objMail = objInbox.Items(i) strSender = objMail.SenderEmailAddress If objDictionary.Exists(strSender) Then objDictionary.Item(strSender) = objDictionary.Item(strSender) + 1 Else objDictionary.Add strSender, 1 End If End If Next Set objExcelApp = CreateObject("Excel.Application") objExcelApp.Visible = True Set objExcelWorkbook = objExcelApp.Workbooks.Add Set objExcelWorksheet = objExcelWorkbook.Sheets(1) With objExcelWorksheet .Cells(1, 1) = "Sender" .Cells(1, 2) = "Count" End With varSenders = objDictionary.Keys varItemCounts = objDictionary.Items For i = LBound(varSenders) To UBound(varSenders) nLastRow = objExcelWorksheet.Range("A" & objExcelWorksheet.Rows.Count).End(xlUp).Row + 1 With objExcelWorksheet .Cells(nLastRow, 1) = varSenders(i) .Cells(nLastRow, 2) = varItemCounts(i) End With Next objExcelWorksheet.Columns("A:B").AutoFit End Sub
- After that, press “F5” key button.
- When macro finishes, a new Excel file will be displayed.
- As you can see, it contains the counts of inbox emails from different senders.
Dispose of Frustrating Outlook Troubles
Maybe you have ever been subject to many problems in your Outlook. In order to address them effectively, you may long for a versatile and mighty way. Yet, in fact, there is not such a method. What you can do is to beware of your own operations in Outlook and make regular backups. Of course, if possible, we suggest that you had better keep an experienced fix tool handy, like DataNumen Outlook Repair. It can fix various PST issues and repair corrupt PST file like a breeze.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover Sql Server and outlook repair software products. For more information visit www.datanumen.com
I copied and pasted it with no modifications and it worked great. Outlook 2021, not o365. It took about 4 hours to run through 22K emails and I wasn’t sure it was going to work but it did. This tool is part of what Outlook lacks in helping clean up an inbox. I was able to look that the biggest senders, search outlook, delete the junk. In the end, I got down to 16K emails remaining. Quite an improvement in my opinion.
1
This line is not working.
strSender = objMail.SenderEmailAddress
Error 430 – Class does not support automation or does not support expected interface.
On line 10. obj ExcelApp I am getting an error: COMPILE ERROR: USER-DEFINED TYPE NOT DEFINED
I’m looking for a script to count number of emails by sender in a subfolder also. Did you figure this out?
I have several mailboxes in Outlook.
I want to apply your Method #2 to one of the folders (not Inbox) of one of the mailboxes.
How do I modify the macro?
Thank you!!!
Is there a way to do this with the archive folders as well? This seems to only check your current server side mailbox