Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to Quickly Count the Sent Emails by Month in Your Outlook

If you store sent emails in several folders and now would like to count all these sent mails by month, you can read this article. Here we will introduce a considerably fast way to get it.

The previous article — “How to Quickly Count Incoming Emails by Date, Month or Year via Outlook VBA” has shared a way to count emails by month. However, it is able to process the emails in one folder. If you want to count emails in several or even all the mail folders, you should use the other means. Thus, in the followings, we will expose another much quicker way to you.
Count the Sent Emails by Month

— To begin with, access Outlook VBA editor via “Alt + F11”.
— Then, enable reference to “MS Excel Object Library” according to “How to Add an Object Library Reference in VBA”.
— After that, put the following VBA code into a project or module.

Dim objDictionary As Object

Sub CountSentMailsByMonth()
Dim objOutlookFile As Outlook.Folder
Dim objFolder As Outlook.Folder
Dim objExcelApp As Excel.Application
Dim objExcelWorkbook As Excel.Workbook
Dim objExcelWorksheet As Excel.Worksheet
Dim varMonths As Variant
Dim varItemCounts As Variant
Dim nLastRow As Integer

Set objDictionary = CreateObject(“Scripting.Dictionary”)
Set objInbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)

‘Get the default Outlook data file
Set objOutlookFile = Outlook.Application.Session.GetDefaultFolder(olFolderInbox).Parent

Add a comment

Related posts: