跳到主要内容

如何在Outlook中按发件人域排序和分组?

通常,我们可以在Microsoft Outlook中轻松按发件人,类别,主题,大小等安排所有电子邮件。 但是,似乎根本无法按发件人域对电子邮件进行分类或分组,因为根本没有用于电子邮件的“发件人域”字段。 在这里,我将介绍一个VBA代码,以帮助您添加电子邮件的“域”列,然后在Outlook中轻松按发件人域对电子邮件进行排序和分组。

Office 选项卡 - 在 Microsoft Office 中启用选项卡式编辑和浏览,让工作变得轻而易举
Kutools for Outlook - 通过 100 多个高级功能增强 Outlook,实现卓越效率
使用这些高级功能增强您的 Outlook 2021 - 2010 或 Outlook 365。 享受全面的 60 天免费试用并提升您的电子邮件体验!

要在Microsoft Outlook 2013和2010中按发件人域对电子邮件进行排序和分组,请执行以下操作:

步骤1:打开邮件文件夹,您将在其中按发件人域对所有电子邮件进行排序。

第2步:通过点击关闭阅读窗格 阅读面板 > 关闭查看 标签。

步骤3:继续,然后按一下 添加列查看 标签。

第3步:在“显示列”对话框中,单击 新的列 按钮。

第4步:在“新建列”对话框中,键入 域名 在名称框中,并保留 文本 在两者中选择 Type 盒子和 格式 框,最后单击 OK 按钮。

第5步:现在,您回到“显示列”对话框,选择 域名 在“按此顺序显示这些列”框中,将其移至下方 项,然后单击 OK 按钮。

第6步:现在,您返回到打开的邮件文件夹,按,选择所有电子邮件。 按Ctrl + A 钥匙在同一时间。

步骤7:按下 其他 + F11 同时键入,以打开“ Microsoft Visual Basic for Applications”窗口; 然后点击 插页 > 模块,接下来将以下VBA代码粘贴到模块中。

VBA:按发件人域排序和分组

Sub ListSelectionDomain()
Dim aObj As Object
Dim oProp As Outlook.UserProperty
Dim sDomain
On Error Resume Next
For Each aObj In Application.ActiveExplorer.Selection
Set oMail = aObj
sDomain = Right(oMail.SenderEmailAddress, Len(oMail.SenderEmailAddress) - InStr(1, oMail.SenderEmailAddress, "@"))
Set oProp = oMail.UserProperties.Add("Domain", olText, True)
oProp.Value = sDomain
oMail.Save
Err.Clear
Next
End Sub

步骤8:按下 F5 键或 运行 按钮。

步骤9:现在,提取每个发件人的域并将其填充到“域”列中。

A. 要按发件人域对电子邮件进行排序,只需单击 域名 在所有电子邮件的顶部;

B. 要按发件人域对电子邮件进行分组,只需右键单击的列标题 域名,并选择 按此字段分组 从下拉列表中。 请参阅以下屏幕截图:

:

(1)此VBA代码在Outlook 2013和2010中运行良好,但在Outlook 2007中不起作用。
(2)您可以轻松保存自定义视图 如何将视图设置保存并复制到Outlook中的其他文件夹?


箭头蓝色右气泡相关文章

如何在Outlook的邮件列表中查看发件人的域?


最佳办公生产力工具

Kutools for Outlook - 超过 100 种强大功能可增强您的 Outlook

🤖 人工智能邮件助手: 具有人工智能魔力的即时专业电子邮件——一键天才回复、完美语气、多语言掌握。轻松改变电子邮件! ...

📧 电子邮件自动化: 外出(适用于 POP 和 IMAP)  /  安排发送电子邮件  /  发送电子邮件时按规则自动抄送/密件抄送  /  自动转发(高级规则)   /  自动添加问候语   /  自动将多收件人电子邮件拆分为单独的消息 ...

📨 电子邮件管理: 轻松回忆电子邮件  /  按主题和其他人阻止诈骗电子邮件  /  删除重复的电子邮件  /  高级搜索  /  合并文件夹 ...

📁 附件专业版批量保存  /  批量分离  /  批量压缩  /  自动保存   /  自动分离  /  自动压缩 ...

🌟 界面魔法: 😊更多又漂亮又酷的表情符号   /  使用选项卡式视图提高 Outlook 工作效率  /  最小化 Outlook 而不是关闭 ...

👍 一键奇迹: 使用传入附件回复全部  /   反网络钓鱼电子邮件  /  🕘显示发件人的时区 ...

👩🏼‍🤝‍👩🏻 通讯录和日历: 从选定的电子邮件中批量添加联系人  /  将联系人组拆分为各个组  /  删除生日提醒 ...

超过 100特点 等待您的探索! 单击此处了解更多。

了解更多       免费下载      购买
 

 

Comments (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks a lot for this article. It took ages to populate the Domain field values for around 10000 mails, in Outlook 2013. The sadder thing is that it does not sort the mails on the Domain field, either descending or ascending. I don't know what is wrong, some update in Outlook disables this, or because the number of mails are huge. The Domain values are displayed, but not sortable or groupable. Kindly help me fix this, thanks.
This comment was minimized by the moderator on the site
I'd like to do the same thing, but for the eMail Address. What values should be adjusted in the above code?
This comment was minimized by the moderator on the site
Getting an error in Outlook 365 (1705) "You cannot sort by this field."
This comment was minimized by the moderator on the site
thanks for your effort, however, domain field does not behave like From field. When you group by domain and sort by another field, domain field disappears. any workarounds ?
This comment was minimized by the moderator on the site
Hi, In the new Outlook 2016 when you sort inbox by sender it then creates headers. I absolutely hate it. How do i remove the useless headers? It never used to happen before. Thanks, Barbs
This comment was minimized by the moderator on the site
Thanks for this, just tried it out in Outlook 2016 and works a treat. Now the next thing which might not be possible but is there a way to then sort the group by domain messages based on the group by count rather than alphabetically based on the domain text?
This comment was minimized by the moderator on the site
[quote]Thanks for this, just tried it out in Outlook 2016 and works a treat. Now the next thing which might not be possible but is there a way to then sort the group by domain messages based on the group by count rather than alphabetically based on the domain text?By Justin[/quote] I can't find the option to add a column in Office 2016 for Mac - Office 365. Any idea? Thank you.
This comment was minimized by the moderator on the site
Works perfect! Many Thanks!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations