How to Open Received/Sent Emails in “Edit” Mode Automatically with Outlook VBA

To change the body of a received or sent email in Outlook, you have to open it and then turn it into “Edit” mode. If you often need to make modifications in such emails, you’ll wish to open them in “Edit” Mode automatically. This post will help you get it.

At times, you may need to alter the content of a received or sent email in Outlook. In this scenario, as introduced in the previous post – “How to Modify the Subject & Body of Received Emails in Outlook“, you have to open the email and click the “Actions” button and choose “Edit Message” to convert the email into “Edit” mode. However, you may think it still a bit troublesome. Therefore, you wish Outlook to always open received/sent emails in “Edit” mode. Thereinafter, we will introduce how to use VBA code to achieve this function. Now read on to get detailed steps.

Edit Message

Open Received/Sent Emails in “Edit” Mode Automatically

  1. At the very outset, with reference to “How to Run VBA Code in Your Outlook“, access Outlook VBA editor.
  2. Then, copy and paste the following VBA code into the “ThisOutlookSession” project.
Public WithEvents objInspectors As Outlook.Inspectors
Public WithEvents objMailInspector As Outlook.Inspector

Private Sub Application_Startup()
    Set objInspectors = Outlook.Application.Inspectors
End Sub

'Get the email window
Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)
    If TypeOf Inspector.CurrentItem Is MailItem Then
       Set objMailInspector = Inspector
    End If
End Sub

Private Sub objMailInspector_Activate()
    Dim objMail As Outlook.MailItem
 
    Set objMail = objMailInspector.CurrentItem
    'If it is a recieved/sent mail instead of a new email
    If Not (objMail.Recipients Is Nothing) And Not (objMail.Sender Is Nothing) Then
       'open in "Edit" mode
       objMailInspector.CommandBars.ExecuteMso ("EditMessage")
    End If
End Sub

VBA Code - Open Received/Sent Emails in "Edit" Mode Automatically

  1. Afterwards, click into the “Application_Startup” macro and press “F5” key.
  2. At present, close the VBA editor.
  3. Finally, you can have a try. Just double click on a received or sent mail to open it. It will surely in the “Edit” mode.Emails in "Edit" Mode

Immune from Outlook Data Loss

Have your PST file ever become inaccessible? In reality, Outlook PST file can get corrupt readily. For instance, email borne viruses can easily lead to Outlook crash and thereby result in Outlook data corruption. In such cases, the first resolution happening to your mind may be inbox repair tool. However, generally speaking, it is incapable of dealing with such serious situations. Hence, it is always suggested to back up PST files at regular intervals, such that you can restore PST data from backups like a cork. Otherwise, you have to fall back on a specialized external tool, like DataNumen Outlook Repair.

Author Introduction:

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

Leave a Reply

Your email address will not be published. Required fields are marked *