如何在回复或转发 Outlook 邮件时,保留邮件的类别?
作者:互联网
2026-04-10
通常,当您回复或转发已设置类别的邮件时,已发送邮件上的类别会自动被移除。如果您希望在回复或转发时,依然在外发邮件上保留类别,本文将为您介绍一种解决方法。
使用 VBA 代码在回复或转发邮件时保留类别
使用 VBA 代码在回复或转发邮件时保留类别
1. 按住 ALT + F11 组合键,即可打开 Microsoft Visual Basic for Applications 窗口。
2. 在 Microsoft Visual Basic for Applications 窗口中,双击 Project 1(VbaProject.OTM) 窗格下的 ThisOutlookSession,进入编辑模式,然后将以下代码复制并粘贴到空白模块中。
VBA 代码:回复或转发邮件时保留类别:
Private WithEvents GExplorer As Outlook.Explorer
Private WithEvents GInspectors As Outlook.Inspectors
Private WithEvents GMailItem As Outlook.MailItem
Private GCategories As String
Private Sub Application_Startup()
Dim xApp As Outlook.Application
Set xApp = Outlook.Application
Set GExplorer = xApp.ActiveExplorer
Set GInspectors = xApp.Inspectors
End Sub
Private Sub GExplorer_SelectionChange()
On Error Resume Next
If TypeName(GExplorer.Selection.Item(1)) <> "MailItem" Then Exit Sub
Set GMailItem = GExplorer.Selection.Item(1)
GCategories = GMailItem.Categories
End Sub
Private Sub GInspectors_NewInspector(ByVal Inspector As Inspector)
On Error Resume Next
If TypeName(Inspector.CurrentItem) <> "MailItem" Then Exit Sub
Set GMailItem = Inspector.CurrentItem
GCategories = GMailItem.Categories
End Sub
Private Sub GMailItem_Forward(ByVal Forward As Object, Cancel As Boolean)
Call GetCategories(Forward)
End Sub
Private Sub GMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
Call GetCategories(Response)
End Sub
Private Sub GMailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
Call GetCategories(Response)
End Sub
Private Sub GetCategories(ByVal NewMail As Object)
If NewMail.Class <> olMail Then Exit Sub
NewMail.Categories = GCategories
End Sub

3. 保存并关闭代码窗口后,关闭并重启 Outlook。现在,当您回复或转发带有类别的邮件时,类别将在外发邮件和已发送邮件中保留,见下方截图:

相关标签:
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
office-quotes:生成《办公室》(美版)语录 - Openclaw Skills
office-xyz: AI 智能体协作虚拟办公室 - Openclaw Skills
办公自动化助手:自动化报告与会议纪要 - Openclaw Skills
工作技能:精通办公室动态与沟通 - Openclaw Skills
在 Outlook 中创建、编辑、使用和共享联系人组
如何在 Outlook 邮件中将图片另存为 JPEG、JPG 或 PNG 格式?
如何在 Outlook 中重命名便笺?
如何在 Outlook 中转发联系人组(通讯组列表)?
如何在 Outlook 中按照删除日期对已删除邮件进行排序?
如何在 Outlook 的邮件窗口中删除收件人(收件人)字段?
AI精选
