如何在 Outlook 中回覆或轉寄郵件時保留類別?
通常,當您回覆或轉寄已分類的郵件時,已傳送郵件中的類別會自動刪除。若您希望在回覆或轉寄時保留外寄郵件的類別,本文將介紹一種處理方法。
使用 VBA 程式碼在回覆或轉寄郵件時保留類別
1. 按住 ALT + F11 鍵以開啟 Microsoft Visual Basic for Applications 視窗。
2. 在 Microsoft Visual Basic for Applications 視窗中,於 Project1(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,現在,當您回覆或轉寄帶有類別的郵件時,該類別將保留在已傳送郵件中的外寄郵件內,請參見截圖:

最佳辦公室生產力工具
最新消息:Kutools for Outlook推出免費版本!
體驗全新的Kutools for Outlook免費版本,擁有70多項令人驚嘆的功能,永久使用!立即點擊下載!
🤖 Kutools AI :使用先進的AI技術輕鬆處理郵件,包括答覆、摘要、優化、擴展、翻譯和撰寫郵件。
📧 郵件自動化:自動回覆(適用於POP和IMAP) / 計劃發送郵件 / 發送郵件時按規則自動抄送密送 / 自動轉發(高級規則) / 自動新增問候語 / 自動將多收件人郵件拆分為個別郵件...
📨 郵件管理:撤回郵件 / 按主題和其他方式阻止詐騙郵件 / 刪除重複郵件 / 高級搜索 / 整合文件夾...
📁 附件專業版:批量保存 / 批量拆離 / 批量壓縮 / 自動保存 / 自動拆離 / 自動壓縮...
🌟 介面魔法:😊更多漂亮和酷炫的表情符号 / 當重要郵件到來時提醒您 / 最小化Outlook而不是關閉...
👍 一鍵奇蹟:帶附件全部答復 / 防止網絡釣魚郵件 / 🕘顯示發件人的時區...
👩🏼🤝👩🏻 聯絡人和日曆:從選中郵件批量新增聯絡人 / 將聯絡人組拆分為個別組 / 移除生日提醒...
立即單擊解鎖Kutools for Outlook。不要等待,立即下載並提升您的效率!

