How to keep category while replying or forwarding email in Outlook? 

Normally, when you reply or forward an email that I have categorized, the category will be removed automatically on the sent email. If you want to keep the category on outgoing emails in replying or forwarding, this article will introduce a method to deal with it.

Keep category while replying or forwarding email with VBA code


Keep category while replying or forwarding email with VBA code

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, double click ThisOutlookSession from the Project1(VbaProject.OTM) pane to open the mode, and then copy and paste the following code into the blank module.

VBA code: Keep category while replying or forwarding email:

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 keep category reply 1

3. Then save and close this code window, close and restart the Outlook, now, when you reply or forward an email with category, the category will be kept in the outgoing message in Sent Items, see screenshot:

doc keep category reply 2


Kutools for Outlook - Brings 100 Advanced Features to Outlook, and Make Work Much Easier!

  • Auto CC/BCC by rules when sending email; Auto Forward Multiple Emails by custom; Auto Reply without exchange server, and more automatic features...
  • BCC Warning - show message when you try to reply all if your mail address is in the BCC list; Remind When Missing Attachments, and more remind features...
  • Reply (All) With All Attachments in the mail conversation; Reply Many Emails in seconds; Auto Add Greeting when reply; Add Date into subject...
  • Attachment Tools: Manage All Attachments in All Mails, Auto Detach, Compress All, Rename All, Save All... Quick Report, Count Selected Mails...
  • Powerful Junk Emails by custom; Remove Duplicate Mails and Contacts... Enable you to do smarter, faster and better in Outlook.
shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121
 

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.