跳到主要內容

如何在Outlook中回复或轉發電子郵件時保持類別? 

通常,當您回复或轉發我已分類的電子郵件時,該類別將在發送的電子郵件中自動刪除。 如果您希望在回复或轉發的外發電子郵件中保留該類別,本文將介紹一種處理方法。

使用VBA代碼在回复或轉發電子郵件時保留類別


使用VBA代碼在回复或轉發電子郵件時保留類別

1. 按住 ALT + F11 鍵打開 Microsoft Visual Basic for Applications 窗口。

2。 在 Microsoft Visual Basic for Applications 窗口,雙擊 本次展望會議 來自 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