If you’re using Outlook rule to auto reply, you will discover that the auto reply can’t include the original message in the body. This article will introduce an easy method, which can insert the original email and predefined text to the body of auto reply via Outlook VBA.
In Outlook, the Exchange accounts permit users to set automatic replies directly via “Automatic Replies” button under “Info” tab in “File” menu, like the following screenshot:
But if you’re using the Internet Email account, no matter IMAP or POP3, there is no the “Automatic Replies” button available. The only way to enable an auto reply is to create an auto reply rule, shown as the following image:
However, this kind of auto reply by Outlook rule cannot automatically include the original message. In reality, most people would like to attach the original email in the message body of the auto reply. In such cases, an auto reply rule can’t realize it certainly. Thus we should make use of Outlook VBA codes. If you’re interested, read on to get the detailed steps and VBA codes.
Auto Reply with the Original Email and a Predefined Text
- At first, you should turn to “Developer” tab and click on “Visual Basic” button.
- Then in the new “Microsoft Visual Basic for Applications” window, you need to double click on “ThisOutlookSession” project in the left side.
- After that, the “ThisOutlookSession” project will open. Now you should copy and paste the following VBA codes into it.
Public WithEvents olItems As Outlook.Items Private Sub Application_Startup() Set olItems = Session.GetDefaultFolder(olFolderInbox).Items End Sub Private Sub olItems_ItemAdd(ByVal Item As Object) Dim olReply As MailItem If Item.Class = olMail Then Set olReply = Item.Reply Else Exit Sub End If With olReply 'Type Your Own Auto Reply 'Change "John Smith" to Your Own Name .Body = "This is a test auto reply." & vbCrLf & vbCrLf & "-------Original Message-------" & vbCrLf & "From: " & Item.Sender & "[mailto: " & Item.SenderEmailAddress & "]" & vbCrLf & "Sent: " & Item.ReceivedTime & vbCrLf & "To: YourName" & vbCrLf & "Subject: " & Item.Subject & vbCrLf & Item.Body .Send End With End Sub
- Next you ought to sign this code as usual and continue to change the macro settings to only allow digitally signed macros.
- Lastly, after completing the above steps, Outlook will send out a reply with the original message information in the body automatically. It would look like the image below:
Note: No matter the auto reply using rule or the auto reply using VBA codes, both of them can only make effects when the Outlook is running.
Address Outlook Data Errors
Without any doubts, Outlook can’t be immune to errors. Hence, it’s essential for Outlook regular users to get some tricks to address them. Obviously, the best way to cope with Outlook data damage is making a regular backup. As long as you get hold of an effective backup, you will rest easy even if Outlook crashes. Of course, out of insurance, you’d better keep a potent repair tool handy as well.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair SQL mdf file corruption and outlook repair software products. For more information visit www.datanumen.com