انتقل إلى المحتوى الرئيسي

كيفية حساب رسائل البريد الإلكتروني حسب الفئة في Outlook؟

ربما تكون قد قمت بتمييز رسائل البريد الإلكتروني مع فئات الألوان في Outlook. ولكن ، هل تعرف كيفية حساب رسائل البريد الإلكتروني حسب الفئات؟ ستشارك هذه المقالة حلين:

علامة تبويب Office - تمكين التحرير والتصفح المبوب في Microsoft Office، مما يجعل العمل سهلاً
Kutools for Outlook - عزز Outlook بأكثر من 100 ميزة متقدمة لتحقيق كفاءة فائقة
عزز Outlook 2021 - 2010 أو Outlook 365 الخاص بك باستخدام هذه الميزات المتقدمة. استمتع بتجربة مجانية شاملة مدتها 60 يومًا وارفع مستوى تجربة بريدك الإلكتروني!

السهم الأزرق الحق فقاعة عد رسائل البريد الإلكتروني حسب الفئة في Outlook باستخدام ميزة البحث الفوري

ستوجهك هذه الطريقة لاكتشاف جميع رسائل البريد الإلكتروني التي تم تمييزها بفئات الألوان المحددة بواسطة البحث الفوري ، ثم احصل بسهولة على العدد الإجمالي لجميع نتائج البحث على شريط الحالة.

1. في ال بريد عرض ، اضغط CTRL + E مفاتيح في وقت واحد لتنشيط أدوات البحث.

2. انقر بحث > مصنف، ثم حدد فئة اللون المحددة التي ستحسب بها رسائل البريد الإلكتروني.

3. الآن تم العثور على جميع رسائل البريد الإلكتروني المميزة بفئة اللون المحددة وإدراجها في قائمة البريد. ويمكنك بسهولة الحصول على العدد الإجمالي لجميع نتائج البحث في شريط الحالة. انظر لقطة الشاشة:

الملاحظات:

(1) لحساب رسائل البريد الإلكتروني المميزة بعلامة فئة صفراء و فئة البرتقال في نفس الوقت ، يرجى كتابة معايير البحث الفئة: = "فئة صفراء" و "فئة برتقالية" في البحث الفوري صندوق مباشر:

(2) لحساب رسائل البريد الإلكتروني المميزة بعلامة فئة صفراء or فئة البرتقال في نفس الوقت ، يرجى كتابة معايير البحث الفئة: = "فئة صفراء" أو "فئة برتقالية" في البحث الفوري مربع مباشرة.


السهم الأزرق الحق فقاعة عد رسائل البريد الإلكتروني حسب الفئة في Outlook باستخدام VBA

ستقدم هذه الطريقة VBA لحساب رسائل البريد الإلكتروني حسب الفئة في نطاق زمني مخصص في Outlook. الرجاء القيام بما يلي:

1. في ال بريد عرض ، حدد مجلد البريد الإلكتروني الذي ستحسب رسائل البريد الإلكتروني.

2. صحافة قديم + F11 في نفس الوقت لفتح نافذة Microsoft Visual Basic for Applications.

3. انقر إدراج > وحدة، ثم الصق رمز فبا أدناه في نافذة الوحدة النمطية الافتتاحية الجديدة:

VBA: عد رسائل البريد الإلكتروني حسب الفئة في Outlook

Sub CategoriesEmails()

Dim oFolder As MAPIFolder
Dim oDict As Object
Dim sStartDate As String
Dim sEndDate As String
Dim oItems As Outlook.Items
Dim sStr As String
Dim sMsg As String


On Error Resume Next
Set oFolder = Application.ActiveExplorer.CurrentFolder

Set oDict = CreateObject("Scripting.Dictionary")

sStartDate = InputBox("Type the start date (format MM/DD/YYYY)")
sEndDate = InputBox("Type the end date (format MM/DD/YYYY)")

Set oItems = oFolder.Items.Restrict("[Received] >= '" & sStartDate & "' And [Received] <= '" & sEndDate & "'")
oItems.SetColumns ("Categories")

For Each aitem In oItems
sStr = aitem.Categories
If Not oDict.Exists(sStr) Then
oDict(sStr) = 0
End If
oDict(sStr) = CLng(oDict(sStr)) + 1
Next aitem

sMsg = ""
For Each aKey In oDict.Keys
sMsg = sMsg & aKey & ":   " & oDict(aKey) & vbCrLf
Next
MsgBox sMsg

Set oFolder = Nothing

 End Sub

4. اضغط على F5 مفتاح أو انقر فوق الزر "تشغيل" لتشغيل VBA.

5. 1 في مربع حوار Microsoft Outlook المنبثق لأول مرة ، يرجى كتابة تاريخ بدء النطاق الزمني المخصص الذي ستحسب فيه رسائل البريد الإلكتروني ، ثم انقر فوق OK . 2 في مربع حوار Microsoft Outlook الثاني ، يرجى كتابة تاريخ الانتهاء والنقر فوق OK زر. انظر لقطات الشاشة:

والآن يظهر مربع حوار ويعرض عدد رسائل البريد الإلكتروني المميزة بفئات الألوان. انظر لقطة الشاشة:


السهم الأزرق الحق فقاعةمقالات ذات صلة


أفضل أدوات إنتاجية المكتب

كوتولس لتوقعات - أكثر من 100 ميزة قوية لتعزيز توقعاتك

🤖 مساعد بريد الذكاء الاصطناعي: رسائل بريد إلكتروني احترافية فورية مع سحر الذكاء الاصطناعي - بنقرة واحدة للردود العبقرية، والنغمة المثالية، وإتقان متعدد اللغات. تحويل البريد الإلكتروني دون عناء! ...

📧 أتمتة البريد الإلكتروني: خارج المكتب (متوفر لـ POP وIMAP)  /  جدولة إرسال رسائل البريد الإلكتروني  /  نسخة تلقائية/نسخة مخفية الوجهة حسب القواعد عند إرسال البريد الإلكتروني  /  إعادة التوجيه التلقائي (القواعد المتقدمة)   /  إضافة تحية تلقائية   /  تقسيم رسائل البريد الإلكتروني متعددة المستلمين تلقائيًا إلى رسائل فردية 

📨 إدارة البريد الإلكتروني: استدعاء رسائل البريد الإلكتروني بسهولة  /  حظر رسائل البريد الإلكتروني الاحتيالية حسب الموضوعات والآخرين  /  حذف رسائل البريد الإلكتروني المكررة  /  المزيد من خيارات البحث  /  توحيد المجلدات 

📁 المرفقات بروحفظ دفعة  /  فصل دفعة  /  ضغط دفعة  /  حفظ تلقائي   /  فصل تلقائي  /  ضغط تلقائي 

؟؟؟؟ واجهة ماجيك: 😊 المزيد من الرموز التعبيرية الجميلة والرائعة   /  عزز إنتاجية Outlook الخاص بك باستخدام طرق العرض المبوبة  /  تصغير Outlook بدلاً من الإغلاق 

؟؟؟؟ بنقرة واحدة عجائب: الرد على الكل بالمرفقات الواردة  /   رسائل البريد الإلكتروني لمكافحة التصيد  /  🕘إظهار المنطقة الزمنية للمرسل 

👩🏼‍🤝‍👩🏻 جهات الاتصال والتقويم: دفعة إضافة جهات الاتصال من رسائل البريد الإلكتروني المحددة  /  تقسيم مجموعة اتصال إلى مجموعات فردية  /  إزالة تذكير عيد ميلاد 

على مدى ميزات 100 في انتظار الاستكشاف الخاص بك! انقر هنا لاكتشاف المزيد.

 

 

Comments (18)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
hi, i was able to do the export to excel, by eliminating the row Dim xWb As Workbook, xWs As Worksheet, but i really need to count the emails on daily basis, on the input date window, if i put the same day it wont give me back any results, i have to put 2 different days for it to work, is there a way around this? so i can count the emails on 1 day instead of 2
This comment was minimized by the moderator on the site
The total number of emails just used to appear beside the Name of the catagory. Does anyone know how to set this?
This comment was minimized by the moderator on the site
Hi,
Instead of only calculating from the selected folder, is there a way to include all the sub folders as well?
This comment was minimized by the moderator on the site
Hi
Did you manage to solve this ?
I would like to count in subfolders to.
This comment was minimized by the moderator on the site
Hello, is there is a possibility to count letters marked with categories if in one letter we have few cases and they must be counted: for example green category - 1 letter with 3 cases inside = 3 green category cases ?


ThANK YOU
This comment was minimized by the moderator on the site
is there a way you can covert this into an excel table?
This comment was minimized by the moderator on the site
Hi Dylan,
Below VBA code will place the count results in a new Excel workbook.
FYI, please enable the reference of “Microsoft Excel 16.0 Object Library” before running the VBA.
Sub CategoriesEmails()
Dim xFolder As MAPIFolder
Dim xDict As Object
Dim xStartDate As String, xEndDate As String
Dim xItems As Outlook.Items
Dim xStr As String, xMsg As String
Dim xExlApp As Object
Dim xWb As Workbook, xWs As Worksheet
Dim I As Integer
On Error Resume Next
Set xExlApp = CreateObject("Excel.Application")
Set xWb = xExlApp.Workbooks.Add
Set xWs = xWb.Sheets.Item(1)
Set xFolder = Application.ActiveExplorer.CurrentFolder
Set xDict = CreateObject("Scripting.Dictionary")
xStartDate = InputBox("Type the start date (format MM/DD/YYYY)")
xEndDate = InputBox("Type the end date (format MM/DD/YYYY)")
Set xItems = xFolder.Items.Restrict("[ReceivedTime] >= '" & xStartDate & "' And [ReceivedTime] <= '" & xEndDate & "'")
'xItems.SetColumns ("Categories")
For Each xItem In xItems
xStr = xItem.Categories
If Not xDict.Exists(xStr) Then
xDict(xStr) = 0
End If
xDict(xStr) = CLng(xDict(xStr)) + 1
Next xItem
xMsg = ""
xWs.Range("A1", "B1").Font.Bold = True
With xWs.Range("A1", "B1")
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
xWs.Cells(1, 1) = "Categories"
xWs.Cells(1, 2) = "Count"
I = 2
For Each xKey In xDict.Keys
If xKey <> "" Then
xWs.Cells(I, 1) = xKey
xWs.Cells(I, 2) = xDict(xKey)
I = I + 1
End If
Next
xWs.Range("A1", "B" + CStr(I)).Columns.AutoFit
xExlApp.Visible = True
Set xFolder = Nothing
End Sub
This comment was minimized by the moderator on the site
Hi guys,
To make the above code run porperly, please first enable the reference of “Microsoft Excel 16.0 Object Library”.
To do so, please do as follows:1. In your Outlook, go to the tab Developer > Visual Basic.2. In the pop-up window, click Tools.3. In the pop-up dialog, check Microsoft Excel 16.0 Object Library, then click OK, see screenshot.
Note that the 16.0 indicates version number, so if it's not the same in your dialog, it doesn't matther. However, if you cannot find the Microsoft Excel (version number) Object Library, make sure that you have Excel installed in your computer.
After you enable the reference, please use the code above.
If you have any further questions, please don't hesitate to let me know.
Amanda
This comment was minimized by the moderator on the site
I know this is an older thread, but if anyone can assist it would be greatly appreciated. When running the code I'm hitting a compile error "User-defined type not defined" for the 8th line "Dim xWB As Workbook, xWs As Worksheet"
This comment was minimized by the moderator on the site
Hi
Did you manage to solve this ?
I got the same problem
Solution:
Simply delete the row:Dim xWb As Workbook, xWs As Worksheet
This comment was minimized by the moderator on the site
Can you add a way to breakout the count columns by day? So I could run a full month and then have counts broken out by day.
This comment was minimized by the moderator on the site
Hi Hannah,

Please try the code below:

<div data-tag="code">Sub CategoriesEmails()
Dim oFolder As MAPIFolder
Dim oDict As Object
Dim sStartDate As String
Dim sEndDate As String
Dim oItems As Outlook.Items
Dim sStr As String
Dim sMsg As String
Dim xStr, xStrDate, xStrDate_D As String
Dim xArr As Variant
Dim xNum As Integer
Dim xRlt As String
On Error Resume Next
Set oFolder = Application.ActiveExplorer.CurrentFolder
xNum = 0
Set oDict = CreateObject("Scripting.Dictionary")
sStartDate = InputBox("Type the start date (format MM/DD/YYYY)")
sEndDate = InputBox("Type the end date (format MM/DD/YYYY)")
Set oItems = oFolder.Items.Restrict("[ReceivedTime] >= '" & sStartDate & "' And [ReceivedTime] <= '" & sEndDate & "'")
oItems.SetColumns ("ReceivedTime")
xStrDate_D = ""
xRlt = ""
For Each aitem In oItems
xStr = aitem.ReceivedTime
If Trim(xStr) <> "" Then
xArr = Split(xStr, " ")
xStrDate = xArr(0)
If xStrDate_D = "" Then
xStrDate_D = xStrDate
xNum = 1
Else
If xStrDate <> "" Then
If xStrDate = xStrDate_D Then
xNum = xNum + 1
Else
If xRlt = "" Then
xRlt = xStrDate_D & ":" & xNum
Else
xRlt = xRlt & vbCrLf & xStrDate_D & ":" & xNum
End If
xStrDate_D = xStrDate
xNum = 1
End If
End If
End If
End If
Next
If xRlt <> "" Then
MsgBox xRlt
Else
MsgBox "No data found."
End If
End Sub
Also, for more statistic analysis, please go to the tab Kutools Plus > Statistics if you have installed Kutools for Outlook. If not, please <a href="https://www.extendoffice.com/download/kutools-for-outlook.html">click here to download</a> and get a 30-day trail for free.
Amanda
This comment was minimized by the moderator on the site
Thank you so much for your help!! I don't think I was clear enough in my initial question. Is there a way to have it break out by category and then give a count by day? So X Category would be broken down by count into date columns?
This comment was minimized by the moderator on the site
This was helpful for me also, thank you so much for sharing!
This comment was minimized by the moderator on the site
Hi , thanks it workd perfectly for month of June, but when I run this for July, it only shows the total number of emails... any idea?
This comment was minimized by the moderator on the site
Hi Thanks, it works perfectly, just one quick query- Can we get the Msgbox results to be displayed in excel, as whenever i want to run the macro it should be displayed in excel.
every time one below the previous results.
This comment was minimized by the moderator on the site
This would be great!
This comment was minimized by the moderator on the site
This is perfect, but how can I change the VBA to include subfolders of the current folder in the count?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations