Прескочи на основното съдържание

Как да групирате и сортирате имейли по месеци в Outlook?

Автор: Кели Последна промяна: 2020-05-08

Имейлите се сортират по дата на получаване във входящата кутия на Outlook по подразбиране. Няма обаче команда за сортиране или групиране на всички имейли по получения месец. Тук ще представя начин за групиране и сортиране на всички имейли по месеци в Outlook.

Групирайте или сортирайте имейли по месеци в Outlook с помощта на VBA код


Групирайте или сортирайте имейли по месеци в Outlook с помощта на VBA код

Този метод ще ви насочи да създадете нова колона, наречена Месец, след това приложете VBA макрос, за да извлечете получения месец в новата колона, след което можете да сортирате или групирате всички имейли по колоната Месец в Outlook.

1.  Отворете пощенска папка, където ще сортирате или групирате имейли по месеци, и щракнете върху Преглед на настройките бутона на Гледка раздел в Outlook 2010 и по-нова версия.

doc сортиране на имейли по месец 1

Забележка: В Outlook 2007 можете да щракнете върху Гледка > Текущия изглед > Персонализиране на текущия изглед.

2. В следващите Разширени настройки на изгледа/Персонализиране на изгледа кликнете върху Колони бутон (или Полетата бутон).

doc сортиране на имейли по месец 2

3. В Показване на колона/полета кликнете върху Нова колона бутон (или Ново поле бутон), за да отворите диалогов прозорец Нова колона/поле, въведете месец в Име кутия, пазете Текст избрани и в двете Тип кутия и формат и след това щракнете върху OK бутон. Вижте екранната снимка по-долу:

doc сортиране на имейли по месец 3

4.  Сега се връщате към Показване на колони/полета диалогов прозорец, щракнете, за да изберете месец елемент в Покажи тези колони (или Полетата) в този ред поле и го преместете под Получени като кликнете върху Премести нагоре и накрая щракнете върху OK бутон.

doc сортиране на имейли по месец 4

5. Щракнете върху OK за да затворите Разширени настройки на изгледа/Персонализиране на изгледа диалогов прозорец.

6. Изберете всички имейли в отварящата се папка, като изберете всеки имейл и след това натиснете Ctrl + A клавиши едновременно.

Забележка: Ако Екран за четене се включва, моля, затворете го, като щракнете върху Гледка > Екран за четене > от.

7. Отвори Microsoft Visual Basic за приложения прозорец с натискане на Друг + F11 междувременно и след това щракнете върху Поставете > Модули.

8. Поставете следния VBA макрос в модула:

VBA: Сортирайте или групирайте имейли по месец

Sub ListSelectionMonth()
	Dim aObj As Object
	Dim oProp As Outlook.UserProperty
	Dim sMonth
	
	On Error Resume Next
	
	For Each aObj In Application.ActiveExplorer.Selection
		Set oMail = aObj
		
		sMonth = Month(oMail.ReceivedTime)
		Set oProp = oMail.UserProperties.Add("Month", olText, True)
		oProp.Value = sMonth
		oMail.Save
		
		Err.Clear
	Next
	
End Sub

9. Натисни F5 ключ за изпълнение на този VBA макрос.

10. Сега всеки получен месец на имейл се извлича в следния месец колона. За да сортирате всички имейли по месеци в тази отваряща се папка, просто щракнете върху заглавката на колоната на месец. Вижте екранна снимка:

doc сортиране на имейли по месец 5

Забележка: За да групирате всички имейли по месеци в тази отваряща папка, щракнете с десния бутон върху заглавката на колоната на месец, след което изберете Групиране по това поле от менюто с десен бутон. Вижте екранна снимка:

doc сортиране на имейли по месец 6


Най-добрите инструменти за продуктивност в офиса

Kutools за Outlook - Над 100 мощни функции, за да заредите вашия Outlook

🤖 AI Mail Assistant: Незабавни професионални имейли с AI магия - с едно щракване до гениални отговори, перфектен тон, многоезично владеене. Трансформирайте имейла без усилие! ...

📧 Автоматизиране на имейли: Извън офиса (налично за POP и IMAP)  /  График за изпращане на имейли  /  Автоматично CC/BCC по правила при изпращане на имейл  /  Автоматично пренасочване (разширени правила)   /  Автоматично добавяне на поздрав   /  Автоматично разделяне на имейлите с множество получатели на отделни съобщения ...

📨 Управление на Email: Лесно извикване на имейли  /  Блокиране на измамни имейли по теми и други  /  Изтриване на дублирани имейли  /  подробно търсене  /  Консолидиране на папки ...

📁 Прикачени файлове ProПакетно запазване  /  Партидно отделяне  /  Партиден компрес  /  Автоматично запазване   /  Автоматично отделяне  /  Автоматично компресиране ...

🌟 Магия на интерфейса: 😊 Още красиви и готини емотикони   /  Увеличете продуктивността на Outlook с изгледи с раздели  /  Минимизирайте Outlook, вместо да затваряте ...

???? Чудеса с едно кликване: Отговорете на всички с входящи прикачени файлове  /   Антифишинг имейли  /  🕘Показване на часовата зона на подателя ...

👩🏼‍🤝‍👩🏻 Контакти и календар: Групово добавяне на контакти от избрани имейли  /  Разделете група контакти на отделни групи  /  Премахнете напомнянията за рожден ден ...

Над 100 Характеристики Очаквайте вашето проучване! Щракнете тук, за да откриете повече.

 

 

Comments (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
If you want to automate further, assign a button to the macro.
There are 2 issues with the macro.
1. You have to select all.
2. The months don't sort correctly because there is no leading 0 for single digits.

This amended code addresses those issues.

Sub ListSelectionMonth()
Dim aObj As Object
Dim oProp As Outlook.UserProperty
Dim sMonth

' Select All Items in current folder
Application.ActiveExplorer.SelectAllItems

On Error Resume Next

For Each aObj In Application.ActiveExplorer.Selection
Set oMail = aObj

sMonth = Month(oMail.ReceivedTime)
'ADD a leading 0 for single digits
If sMonth < 10 Then sMonth = "0" & sMonth
Set oProp = oMail.UserProperties.Add("Month", olText, True)
oProp.Value = sMonth
oMail.Save

Err.Clear
Next

End Sub
This comment was minimized by the moderator on the site
I have Outlook 2007 and have try that VBA. First I did have the problem that only 1 E-Mail of all get the month show.
I needed to mark all E-Mails first and then push in VBA F5 to show in all E-Mails the month.

a bad part of that code is that all month (1, 2, 3, 4, 5, 6, 7, 8, 9) get grouped on the wrong position in front of 10, 11, 12
is there any additional VBA sequence what add to the first 9 Month a 0? ergo 01, 02, 03 etc?

as I have several years in some folders it make sense to group those E-Mails first by year and after that by Month.
This comment was minimized by the moderator on the site
Strange.
Made a restart. Now it works.Sorry for bothering.
Thx again :) <3
This comment was minimized by the moderator on the site
Sorry. Didn't saw that the page is origin in english. #emabarrased
Google translate is getting better. :D
Hello from Hamburg,
great stuff. Thanks for this. :)
Only a small problem.
I had first adapted the code so that it puts the year and month together for me.

Sub ListSelectionYearMonth()
Dim aObj As Object
Dim oProp As Outlook.UserProperty
Dim oMail As Object
Dim sMonth
Dim sYear
Dim sYearMonth

On Error Resume Next

For Each aObj In Application.ActiveExplorer.Selection
Set oMail = aObj

sMonth = Month(oMail.ReceivedTime)
sYear = Year(oMail.ReceivedTime)

If sMonth < 10 Then
sMonth = 0 & sMonth
Else
sMonth = sMonth
End If

sYearMonth = sYear & "/" & sMonth
Set oProp = oMail.UserProperties.Add("YearMonth", olText, True)
oProp.Value = sYearMonth
oMail.Save

Err.Clear
Next

End Sub

This worked wonderfully.
Now I noticed in a folder that a grouping first by year and then by month increases the clarity.
I used the original code.
However, the column there remains empty.

Sub ListSelectionMonth()
Dim aObj As Object
Dim oProp As Outlook.UserProperty
Dim oMail As Object
Dim sMonth

On Error Resume Next

For Each aObj In Application.ActiveExplorer.Selection
Set oMail = aObj

sMonth = Month(oMail.ReceivedTime)

If sMonth < 10 Then
sMonth = 0 & sMonth
Else
sMonth = sMonth
End If

Set oProp = oMail.UserProperties.Add("Month", olText, True)
oProp.Value = sMonth
oMail.Save

Err.Clear
Next

End Sub

I'm a bit perplexed at the moment.

Glad about any advice

VG
Armin


Translated with http://www.DeepL.com/Translator (free version)
This comment was minimized by the moderator on the site
Hallo aus Hamburg,super Sache. Danke dafür. :)Kleines Problem nur.Ich hatte zuerst den Code so angepasst das er mir Jahr und Monat zusammensetzt.
Sub ListSelectionYearMonth()
Dim aObj As Object
Dim oProp As Outlook.UserProperty
Dim oMail As Object
Dim sMonth
Dim sYear
Dim sYearMonth

On Error Resume Next

For Each aObj In Application.ActiveExplorer.Selection
Set oMail = aObj

sMonth = Month(oMail.ReceivedTime)
sYear = Year(oMail.ReceivedTime)

If sMonth < 10 Then
sMonth = 0 & sMonth
Else
sMonth = sMonth
End If

sYearMonth = sYear & "/" & sMonth
Set oProp = oMail.UserProperties.Add("JahrMonat", olText, True)
oProp.Value = sYearMonth
oMail.Save

Err.Clear
Next

End Sub

Hat wunderbar geklappt.Nun ist mir in einem Ordner aufgefallen das eine Gruppierung zuersnach Jahr und dann nach Monat die Übersichtlichkeit noch erhöht.Habe als den ursprünglichen Code genommen.Dort bleibt dann allerdings die Spalte leer.
Sub ListSelectionMonth()
Dim aObj As Object
Dim oProp As Outlook.UserProperty
Dim oMail As Object
Dim sMonth

On Error Resume Next

For Each aObj In Application.ActiveExplorer.Selection
Set oMail = aObj

sMonth = Month(oMail.ReceivedTime)

If sMonth < 10 Then
sMonth = 0 & sMonth
Else
sMonth = sMonth
End If

Set oProp = oMail.UserProperties.Add("Monat", olText, True)
oProp.Value = sMonth
oMail.Save

Err.Clear
Next

End Sub

Macht mich grad etwas ratlos.
Freue mich über jeden Rat
VGArmin
This comment was minimized by the moderator on the site
This will also help.
This comment was minimized by the moderator on the site
The code works as in the article. But it does not apply to new letters. Every time you need to go to the created module in the Visual Basik and press F5.
This comment was minimized by the moderator on the site
I used the above vba and let me begin by saying this does help in micro management which is not available by default. this is beneficial for archival and storage and not something supposed to work automatically for incoming email. I was able to modify this a bit and also add a year column. So for all emails I was able to get a month and year so that I can group and then regroup (by year and then by month). What I did find however is there is some kind of limitation to the number of items it goes through and then exists (not sure why). For example if I were to select a folder with 18k-19k emails, it will loop only through some and then at the end of the run it will not update all the emails with the required. However if you run in smaller batches then it runs perfectly fine. The painful part here is to keep on selecting in batches. This is a pain for people like me who wish to manage or rather arrange years or emails that runs in a 6 figures in numbers. Anyone here been able to figure this out out or willing to go on a troubleshooting spree to fix this or how this can be addressed ?
This comment was minimized by the moderator on the site
That is, I want to group mails by subject and put the group with maximum mails on the top. How can I do that?
This comment was minimized by the moderator on the site
I want to :

1. Group mails by subject

2. Sort them by number of e-mails inside the group

How can I do achieve this?
This comment was minimized by the moderator on the site
I want this too
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations