How to Auto Clear the Flag of an Email When Replying It in Outlook

If you intend to reply an email later, you may first flag it. Then when you complete replying it, you can clear the flag. This article can teach you how to let Outlook auto clear the flag when you reply the email.

Outlook provides us with the “Flag” feature, by which we can follow up an email more conveniently. For example, when receiving an email, which requests you to send a reply, you may want to put it aside for a while as you need to make some other precautions, such as writing some important documents and so on. In this case, you can flag the mail for follow up, which will make the email more striking and prevent you from forgetting to reply it. Then after you reply it, you can clear the flag.

This feature is certainly helpful, but you may feel it cumbersome that you have to clear flag manually. You must hope that Outlook can automatically clear the flag when you replying the email. To achieve this, you need to make use of VBA. Here are the elaborate steps and codes.

Auto Clear the Flag of an Email When Replying It

  1. In the first place, launch Outlook application and head to “Developer” tab. If you cannot find this tab, you can go to “File” > “Options” > “Customize Ribbon” to enable it.
  2. Then click on “Visual Basic” button, which will bring you to VBA editor.
  3. Next in the new window, you should open the “ThisOutlookSession” project and copy the following codes into it.
Public WithEvents olExplorer As Outlook.Explorer
Public WithEvents oMail As Outlook.MailItem

Private Sub Application_Startup()
    Set olExplorer = Outlook.Application.ActiveExplorer
End Sub

Private Sub olExplorer_SelectionChange()
    On Error Resume Next
    Set oMail = olExplorer.Selection.Item(1)
End Sub

Private Sub oMail_Reply(ByVal Response As Object, Cancel As Boolean)
    If oMail.IsMarkedAsTask = True Then
       ClearFlag
    End If
End Sub

Private Sub oMail_ReplyAll(ByVal Response As Object, Cancel As Boolean)
    If oMail.IsMarkedAsTask = True Then
       ClearFlag
    End If
End Sub

Private Sub ClearFlag()
    With oMail
         .ClearTaskFlag
         .Categories = "Replied"
         .Save
    End With
End Sub

VBA Codes - Auto Clear the Flag of an Email When Replying It

  1. After that, you should continue to digitally sign this project. If you have no existing certificate, create a new one by inbox tool – Digital Certificates for VBA Projects.Sign the New VBA Project
  2. Subsequently, you can exit the current window and change Outlook macro security level to low.
  3. Eventually start Outlook to activate the new VBA project. From now on, Outlook will automatically clear the flag as soon as you click “Reply” button.

Don’t Bypass Any Outlook Problems

Since Outlook is vulnerable, you should keep cautious of all the Outlook problems. Any mistakes can damage your Outlook without any omens. Therefore, it is wise to prepare a damaged PST file recovery tool, like DataNumen Outlook Repair. It will come in handy when you suffer serious troubles and the inbox repair tool can’t make effects.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair damaged SQL Server mdf file and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.