---
description: 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.
title: How to Auto Reply with the Original Email and a Predefined Text via Outlook VBA
image: https://www.datanumen.com/blogs/wp-content/uploads/2017/01/Automatic-Replies-in-MS-Excahnge-Account.jpg
---

-
-
-

[Home](https://www.datanumen.com/blogs/) > [Solutions](https://www.datanumen.com/blogs/category/solutions/) > [Office Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/) > [Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) > How to Auto Reply with the Original Email and a Predefined Text via Outlook VBA

# How to Auto Reply with the Original Email and a Predefined Text via Outlook VBA

[Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) September 29, 2025

Share Now:

-
-
-
-
-
-
-
-

*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:

![Automatic Replies in MS Excahnge Account](https://www.datanumen.com/blogs/wp-content/uploads/2017/01/Automatic-Replies-in-MS-Excahnge-Account.jpg "Automatic Replies in MS Excahnge Account")

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:

![Auto Reply Rule](https://www.datanumen.com/blogs/wp-content/uploads/2017/01/Auto-Reply-Rule.jpg "Auto Reply Rule")

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

1. At first, you should turn to “Developer” tab and click on “Visual Basic” button.
2. Then in the new “Microsoft Visual Basic for Applications” window, you need to double click on “ThisOutlookSession” project in the left side.
3. 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
```

![Auto Reply VBA Codes]( "Auto Reply VBA Codes")

4. Next you ought to sign this code as usual and continue to change the macro settings to only allow digitally signed macros.
5. 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:![Auto Reply with the Original Email and a Predefined Text]( "Auto Reply with the Original Email and a Predefined Text")

**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](https://www.datanumen.com/outlook-repair/) 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](https://www.datanumen.com/sql-recovery/) and outlook repair software products. For more information visit [www.datanumen.com](https://www.datanumen.com)

Share Now:

-
-
-
-
-
-
-
-

[← Previous post](https://www.datanumen.com/blogs/auto-assign-task-specific-person-scheduled-time-outlook-vba/)

[Next post →](https://www.datanumen.com/blogs/2-methods-to-sort-a-column-with-both-numbers-and-texts-in-your-excel/)

Comments are closed.

![Data Recovery Blog]()

Follow or like us on Facebook, LinkedIn and Twitter to get all promotions, latest news and updates on our products and company.

-
-
-

### Featured Products

- [DataNumen Outlook Repair](https://www.datanumen.com/outlook-repair/)
- [DataNumen SQL Recovery](https://www.datanumen.com/sql-recovery/)
- [DataNumen Exchange Recovery](https://www.datanumen.com/exchange-recovery/)
- [DataNumen Access Repair](https://www.datanumen.com/access-repair/)
- [DataNumen Excel Repair](https://www.datanumen.com/excel-repair/)
- [DataNumen PDF Repair](https://www.datanumen.com/pdf-repair/)
- [DataNumen Word Repair](https://www.datanumen.com/word-repair/)
- [DataNumen Zip Repair](https://www.datanumen.com/zip-repair/)

### Popular posts

```json
{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/#article","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/"},"author":{"name":"AuthorCCW","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957"},"headline":"How to Auto Reply with the Original Email and a Predefined Text via Outlook VBA","datePublished":"2017-01-03T01:10:35+00:00","dateModified":"2025-09-29T10:59:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/"},"wordCount":461,"commentCount":3,"publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/01\/Automatic-Replies-in-MS-Excahnge-Account.jpg","articleSection":["Outlook Solutions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/","url":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/","name":"How to Auto Reply with the Original Email and a Predefined Text via Outlook VBA","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/#primaryimage"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/01\/Automatic-Replies-in-MS-Excahnge-Account.jpg","datePublished":"2017-01-03T01:10:35+00:00","dateModified":"2025-09-29T10:59:44+00:00","description":"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.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/auto-reply-original-email-predefined-text-via-outlook-vba\/#primaryimage","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/01\/Automatic-Replies-in-MS-Excahnge-Account.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/01\/Automatic-Replies-in-MS-Excahnge-Account.jpg","width":881,"height":446,"caption":"Automatic Replies in MS Excahnge Account"},{"@type":"WebSite","@id":"https:\/\/www.datanumen.com\/blogs\/#website","url":"https:\/\/www.datanumen.com\/blogs\/","name":"Data Recovery Blog","description":"Discuss every aspect of data recovery","publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanumen.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanumen.com\/blogs\/#organization","name":"Data Recovery Blog","url":"https:\/\/www.datanumen.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","width":296,"height":397,"caption":"Data Recovery Blog"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataNumen","https:\/\/x.com\/DataNumen","http:\/\/www.linkedin.com\/company\/datanumen","https:\/\/myspace.com\/datanumen\/","http:\/\/www.pinterest.com\/datanumen\/","https:\/\/www.youtube.com\/channel\/UCVIIuuKfUBHSJauUaVP13tw"]},{"@type":"Person","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957","name":"AuthorCCW","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","caption":"AuthorCCW"},"sameAs":["https:\/\/www.datanumen.com\/"]}]}
```
