How to count the number of flagged messages in Outlook?
In outlook, you can flag the messages, contacts or tasks for making them outstanding, but, sometimes, you need to count the number of flagged items in your Outlook. How could you deal with this task in Outlook?
Count the number of flagged messages in one account with Search Folders
Count the number of flagged messages / contacts / tasks separately in all accounts with VBA code
a name="a1"> Count the number of flagged messages in one account with Search Folders
To count the number of flagged emails in an account of Outlook, the Search Folders feature can help you, please do as this:
1. Right click Search Folders under your Email account, and then select New Search Folder, see screenshot:

2. Then a New Search Folder dialog box is popped out, click Mail flagged for follow up option in the Reading Mail section, see screenshot:

3. Then click OK, and all flagged messages are copied into the For Follow Up folder, and the total number of the flagged emails is displayed as following screenshot shown:

a name="a2"> Count the number of flagged messages / contacts / tasks separately in all accounts with VBA code
If you want to count the number of all flagged items, such as emails, contacts and tasks in Outlook separately, the following VBA code can do you a favor.
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Then, click Insert > Module, copy and paste below code into the opened blank module, see screenshot:
VBA code: Count the number of flagged times in Outlook:
Dim GSeparateCount, GMailCount, GContactCount, GTaskCount As Long
Sub CountFlaggedItems()
Dim xStore As Outlook.Store
Dim xTotalCount As Long
Dim xPrompt As String
Dim xFolder As Folder
Dim i, k As Integer
On Error Resume Next
xTotalCount = 0
GMailCount = 0
GContactCount = 0
GTaskCount = 0
For Each xStore In Application.Session.Stores
For Each xFolder In xStore.GetRootFolder.Folders
Call ProcessFolders(xFolder)
Next
Next
xTotalCount = GMailCount + GContactCount + GTaskCount
xPrompt = xTotalCount & " items have been flagged, as follows: " & Chr(10) & Chr(10) & "Emails: " & GMailCount & Chr(10) & "Contacts: " & GContactCount & Chr(10) & "Tasks: " & GTaskCount
MsgBox xPrompt, vbInformation + vbOKOnly, "Kutools for Outlook"
End Sub
Sub ProcessFolders(ByVal CurFolder As Outlook.Folder)
Dim xSubfolder As Outlook.Folder
Dim xItem As Object
Dim i, k As Integer
On Error Resume Next
For i = CurFolder.Items.Count To 1 Step -1
Set xItem = CurFolder.Items.item(i)
Select Case xItem.Class
Case olMail, olPost, olSharing
If xItem.IsMarkedAsTask = True Then
GMailCount = GMailCount + 1
End If
Case olContact, olDistList
If xItem.IsMarkedAsTask = True Then
GContactCount = GContactCount + 1
End If
Case olTask
If CurFolder.DefaultItemType = olTaskItem Then
GTaskCount = GTaskCount + 1
End If
End Select
Next i
If CurFolder.Folders.Count > 0 Then
For k = CurFolder.Folders.Count To 1 Step -1
Set xSubfolder = CurFolder.Folders.item(k)
Call ProcessFolders(xSubfolder)
Next k
End If
End Sub

3. Then press F5 key to run this code, and a prompt box is popped out to tell you the total count of all flagged items as below screenshot shown:

Count the number of today, yesterday, read, unread, total items...in Outlook With Kutools for Outlook's powerful Statistics feature, you can get the number of itmes based on date, selected items, read, unread and so on as you need. ![]() Kutools for Outlook: with more than 70+ handy and free Outlook add-ins, download the free version now . |
Best Office Productivity Tools
Breaking News: Kutools for Outlook Launches Free Version!
Experience the all-new Kutools for Outlook with 100+ incredible features! Click to download now!
π€ Kutools AI : Uses advanced AI technology to handle emails effortlessly, including replying, summarizing, optimizing, extending, translating, and composing emails.
π§ Email Automation: Auto Reply (Available for POP and IMAP) / Schedule Send Emails / Auto CC/BCC by Rules When Sending Email / Auto Forward (Advanced Rules) / Auto Add Greeting / Automatically Split Multi-Recipient Emails into Individual Messages ...
π¨ Email Management: Recall Emails / Block Scam Emails by Subjects and Others / Delete Duplicate Emails / Advanced Search / Consolidate Folders ...
π Attachments Pro: Batch Save / Batch Detach / Batch Compress / Auto Save / Auto Detach / Auto Compress ...
π Interface Magic: πMore Pretty and Cool Emojis / Remind you when important emails come / Minimize Outlook Instead of Closing ...
π One-click Wonders: Reply All with Attachments / Anti-Phishing Emails / πShow Sender's Time Zone ...
π©πΌβπ€βπ©π» Contacts & Calendar: Batch Add Contacts From Selected Emails / Split a Contact Group to Individual Groups / Remove Birthday Reminders ...
Use Kutools in your preferred language β supports English, Spanish, German, French, Chinese, and 40+ others!


π One-Click Download β Get All Office Add-ins
Strongly Recommended: Kutools for Office (5-in-1)
One click to download five installers at once β Kutools for Excel, Outlook, Word, PowerPoint and Office Tab Pro. Click to download now!
- β One-click convenience: Download all five setup packages in a single action.
- π Ready for any Office task: Install the add-ins you need, when you need them.
- π§° Included: Kutools for Excel / Kutools for Outlook / Kutools for Word / Office Tab Pro / Kutools for PowerPoint