I'm often asked how to set Outlook to always reply in a specific format. While I don't recommend changing the reply format (because the sender choose the format for a reason), you can change it using a macro.
How do I set Outlook to always reply in HTML or RTF? When replying to, or forwarding, an email that is in plain text format, it always uses plain text. I want to force it to use RTF or HTML. I know I can change it every time, but I want it to be automatic.
The answer: Outlook does not offer a way to always use a specific format for all replies, be it RTF or HTML. You need to either change it on each message or write VBA macro to change the format. (You can force plain text replies to all messages by using the option to read all mail in plain text.)
We do not recommend always using HTML format (and certainly not RTF format) because you cannot be 100% sure that the sender is not using a smartphone or other device to read and reply to their mail. Many devices use plain text, either by default or as an option to the user and you should avoid changing the format on replies unless you have a valid reason - such as highlighting text, inserting tables or using bullet points. If you are replying with basic paragraphs of text, respect the sender's choice of plain text format.
Absolutely do not use RTF format for any message unless you know for a fact that the recipient will be reading it in Outlook (or OWA), otherwise they will get a plain text message and a winmail.dat attachment.
One of the readers of our Outlook Daily Tips mailing list posted the following macro. It was tested on Outlook 2007 and Outlook 2010 but should work on other versions.
Choose if you want to reply in HTML or plain text in this line:
'olFormat = olFormatPlain '(*1) - always use plain text
olFormat = olFormatHTML '(*2) - always use HTML
In the macro below, reply, forward, reply to all is generated using HTML.
If You want it to be in plain, comment out the HTML line and uncomment the plain text line, like this:
olFormat = olFormatPlain '(*1) - always use plain text
'olFormat = olFormatHTML '(*2) - always use HTML
And don't forget to disable macro warnings!
The Code
Copy and paste the code from this page into your ThisOutlookSession project.
In Outlook, press Alt+F11 to open the VBA editor and expand Microsoft Outlook Objects then double click on ThisOutlookSession to open it in the editing pane and Ctrl+P to paste the code.
This macro runs on application start up and monitors reply events. To test it without restarting, you can click within the Application_Startup macro and press the Run button in the Toolbar.
You'll also need to set macro security to allow the macro to run. While the low setting is OK for testing, we recommend using SelfCert to sign the macro if you are using it long-term.
Option Explicit Private WithEvents oExpl As Explorer Private WithEvents oItem As MailItem Private bDiscardEvents As Boolean Private olFormat As OlBodyFormat Private Sub Application_Startup() Set oExpl = Application.ActiveExplorer bDiscardEvents = False 'olFormat = olFormatPlain '(*1) - reply using plain text olFormat = olFormatHTML '(*2) - reply using HTML End Sub Private Sub oExpl_SelectionChange() On Error Resume Next Set oItem = oExpl.Selection.Item(1) End Sub Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean) If bDiscardEvents Or oItem.BodyFormat = olFormat Then Exit Sub End If Cancel = True bDiscardEvents = True Dim oResponse As MailItem Set oResponse = oItem.Reply oResponse.BodyFormat = olFormat oResponse.Display bDiscardEvents = False End Sub Private Sub oItem_ReplyAll(ByVal Response As Object, Cancel As Boolean) If bDiscardEvents Or oItem.BodyFormat = olFormat Then Exit Sub End If Cancel = True bDiscardEvents = True Dim oResponse As MailItem Set oResponse = oItem.ReplyAll oResponse.BodyFormat = olFormat oResponse.Display bDiscardEvents = False End Sub Private Sub oItem_Forward(ByVal Forward As Object, Cancel As Boolean) If bDiscardEvents Or oItem.BodyFormat = olFormat Then Exit Sub End If Cancel = True bDiscardEvents = True Dim oResponse As MailItem Set oResponse = oItem.Forward oResponse.BodyFormat = olFormat oResponse.Display bDiscardEvents = False End Sub
Always Reply using Plain Text, Change Header
This version of the oItem_Reply macro always replies using plain text and changes the header block at the top of the message from this:
-----Original Message-----
From: EMO [mailto:emo@slipstick.com]
Sent: Friday, November 18, 2016 3:14 AM
Subject: Exchange Messaging Outlook: Goodbye RPC over HTTP
To this:
On Fri, Nov 18, 2016 at 03:14:18, EMO wrote:
This macro will always use plain text. If you want to maintain the format and only change the header, use the code sample from In-line reply style in Outlook.
Option Explicit Private WithEvents oExpl As Explorer Private WithEvents oItem As MailItem Private bDiscardEvents As Boolean Dim oResponse As MailItem Private Sub Application_Startup() Set oExpl = Application.ActiveExplorer bDiscardEvents = False End Sub Private Sub oExpl_SelectionChange() On Error Resume Next Set oItem = oExpl.Selection.Item(1) End Sub ' Reply Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean) Cancel = True bDiscardEvents = True ' these two lines change the format and add > to the plain text reply oItem.BodyFormat = olFormatPlain oItem.Actions("Reply").ReplyStyle = olReplyTickOriginalText Set oResponse = oItem.Reply afterReply End Sub Private Sub oItem_Forward(ByVal Response As Object, Cancel As Boolean) Cancel = True bDiscardEvents = True ' these two lines change the format and add > to the plain text reply oItem.BodyFormat = olFormatPlain oItem.Actions("Forward").ReplyStyle = olReplyTickOriginalText Set oResponse = oItem.Forward afterReply End Sub Private Sub oItem_ReplyAll(ByVal Response As Object, Cancel As Boolean) Cancel = True bDiscardEvents = True ' these two lines change the format and add > to the plain text reply oItem.BodyFormat = olFormatPlain oItem.Actions("Reply to All").ReplyStyle = olReplyTickOriginalText Set oResponse = oItem.ReplyAll afterReply End Sub Private Sub afterReply() Dim datestr As String Dim orgBody As String Dim myBody As String Dim newBody As String Dim name As String Dim pos Dim b Dim Lines Dim myLine bDiscardEvents = True ' Delete the signature from the top of the message Dim objDoc As Object 'Word.Document Dim oBookmark As Object 'Word.Bookmark On Error Resume Next Set objDoc = oItem.GetInspector.WordEditor Set oBookmark = objDoc.Bookmarks("_MailAutoSig") If Not oBookmark Is Nothing Then oBookmark.Select objDoc.Windows(1).Selection.Delete End If 'if you want to add a signature at the end 'Set objFSO = CreateObject("Scripting.FileSystemObject") ''Edit the signature file name on the following line as needed' 'Set objSignatureFile = objFSO.OpenTextFile("C:\path-to-signature.txt") 'sig = objSignatureFile.ReadAll 'objSignatureFile.Close name = oItem.SentOnBehalfOfName datestr = Format(oItem.SentOn, "DDD, MMM dd, yyyy at HH:mm:ss") ' - Remove Outlook-style reply header orgBody = oResponse.Body pos = InStr(orgBody, ">") - 1 myBody = Mid(orgBody, pos + 1) b = 0 Lines = Split(myBody, vbNewLine) For Each myLine In Lines If b > 4 Then newBody = newBody & myLine & vbNewLine End If b = b + 1 Next ' Put new body together oResponse.Body = "On " & datestr & ", " & name & " wrote:" _ & vbNewLine & newBody & vbNewLine '& sig oResponse.Display bDiscardEvents = False 'close the message you are replying to without saving changes ' (it was converted to plain text) oItem.Close olDiscard End Sub
How to use the Macro
First: You will need macro security set to low during testing.
To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security. If Outlook tells you it needs to be restarted, close and reopen Outlook. Note: after you test the macro and see that it works, you can either leave macro security set to low or sign the macro.
Now open the VBA Editor by pressing Alt+F11 on your keyboard.
To use the macro code in ThisOutlookSession:
- Expand Project1 and double click on ThisOutlookSession.
- Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
Application_Startup macros run when Outlook starts. If you are using an Application_Startup macro you can test the macro without restarting Outlook by clicking in the first line of the Application_Startup macro then clicking the Run button on the toolbar or pressing F8.
More information as well as screenshots are at How to use the VBA Editor.
Many thanks for this--it was an excellent example that helped me to implement this. I would note that it does not support the Use Case where someone Declines a Meeting Request and you want to respond to their Decline note, because it does not handle MeetingItems, but that was relatively easy to fix once I figured that out--just need a similar oMeetingItem object as the oItem object in the example above. I also modularized it such that the real meat of the code is in one function that is called by the various event handlers.
One issue that I hit, however, is that when this is implemented, the content of the Reply is all considered "new text", which means that when I hit send and the spellchecker kicks in, it does not check solely my actual reply, but the entire thread, even though the "Ignore original message text in reply or forward" is checked.
I will look into determining if there is a way to prevent that, but if anyone has any ideas how I can avoid this, I would love to hear them.
Sadly this script did not work for me in Outlook 2019. But using AutoHotkey I got it to work. As soon as I open a plain text message AHK quickly switches to the Format menu, selects HTML and switches back, it's barely noticable. This script can be found in this thread on the Microsoft Forum:
https://social.technet.microsoft.com/Forums/ie/en-US/d55e55d5-f8d4-4358-85cc-cc17d5d92b51/outlook-2010-always-reply-using-html-format-option
Search for AutoHotkey.
I would really like to know what smartphone can't read HTML email... It's 2017 all Android and iOS phones can read HTML, also if your webmail can't read HTML email you need to have your provider change that ASAP.
there are still a few that can't do HTML but it's not just about the device supporting it, it's also the "cost" of html in data. My sister does not have unlimited data and her only internet access is through the phone; converting her messages to html would add about 10 kb to each message. It's not just cellular providers who set data limits - not everyone has unlimited data.
Hello Diane. Thank you for this! I have successfully implemented your code, except not the "Change the Reply Font" code you provided, quoted here again. Where do I insert this code, please?
oResponse.HTMLBody = " " & oResponse.HTMLBody
Add the line between these if there is a not a line that sets the HTMLBody already in the code.
oResponse.BodyFormat = olFormat
oResponse.Display
Thank you for this post. I hope that there is something that can be modified to allow me to bypass the problems that I have.
Specifically, there are instances where my Reply to a message assumes some formatting from the original message, causing the spacing between paragraphs to be abnormally big. Additionally, when I Reply to a message from someone in South Korea, the lines become justified and then break the words at irregular spots without hyphenation.
I can correct this by choosing Format Text-->Styles-->Change Styles-->Style Set-->Reset to Quick Styles from Template
I would love it if there was a way to automatically do this! It only impacts HTML-based messages - I don't recall seeing this issue if the original post was a pure text-based message. And I don't necessarily want to override from Text to HTML, out of respect for the recipient. But I don't want to have to do the process described above every time I type a message to one of those problematic recipients.
Thank you!
Thank you!
Thanks for this script.
I'm using it but when I reply to an email, the font changes to Times New Roman.
I need Verdana, 10pt, grey. How can I change that?
In the settings of Outlook 2010 are the right font settings.
This happens because Outlook uses word as the editor - you can change the font fairly easily, but changing the font size is a little more complicated and i don't have a sample that does that. You'll add the oResponse.HTMLBody line as shown in this snippet - and can remove the bodyformat line.
Dim oResponse As MailItem
Set oResponse = oItem.Reply
oResponse.HTMLBody = " " & " " & oResponse.HTMLBody
oResponse.Display
bDiscardEvents = False
This code does not work, there is a synthax error in the font definition line and also in. bDiscardEvents = False
it looks like the conversion from WordPress to Disqus messed the code up. Every "&" should be "&" - it was converted to the html code for &. (The = multiplied too.)
The correct code (assuming it doesn't get messed up again) is
[code]oResponse.HTMLBody = "<font face=" & Chr(34) & " verdana" & Chr(34) & "> <font color=" & Chr(34) & " green" & Chr(34) & "> " & oResponse.HTMLBody[/code]
The 2 closing font tags were added by the web software too. Outlook will rewrite the color tags to CSS and properly close the tags when you hit Send.
I updated the article to include this line of code.
i love the the above code, any way to insert me signal to it
Thanks for this, with the altering of Macro security this now works just fine.
I had the problem mentioned by other poster whereby the signiature is inserted in plain text not HTML.
My way round the problem is to set outlook to not automatically add a sig to replies.
I then click reply and then click insert signiature
The sig has a few lines of text in my preferred font above the sig image, so I can then just click in that section and start typing in the desired font.
Yes this is a bit of a faff, but it leaves me with $30 to spend on beer instead :)
Beer is better than outlook. :) Depending on your version of Outlook, you can customize the toolbar, ribbon, or QAT to make the Insert signature command a step away, reducing your effort further.