跳到主要内容

如何在Outlook中回复或转发电子邮件时保持类别? 

通常,当您回复或转发我已分类的电子邮件时,该类别将在发送的电子邮件中自动删除。 如果您希望在回复或转发的外发电子邮件中保留该类别,则本文将介绍一种处理方法。

使用VBA代码回复或转发电子邮件时保持类别


使用VBA代码回复或转发电子邮件时保持类别

1. 按住 ALT + F11 键打开 Microsoft Visual Basic应用程序 窗口。

2。 在 Microsoft Visual Basic应用程序 窗口,双击 本次展望会议 来自 Project1(VbaProject.OTM) 窗格以打开模式,然后将以下代码复制并粘贴到空白模块中。

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

doc保留类别回复1

3。 然后保存并关闭此代码窗口,关闭并重新启动Outlook,现在,当您回复或转发带有类别的电子邮件时,该类别将保留在 发送的邮件,请参见屏幕截图:

doc保留类别回复2


最佳办公生产力工具

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

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

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

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

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

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

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

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

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

了解更多       免费下载      购买
 

 

Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This doesn't work.

I keep getting "invalid atttribute in sub or function" error
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations