Outlook uses Word as the HTML rendering engine and although many features have been added over the years and marketers have compensated for these limitations, it could still sometimes end up in a malformed display of the email message.
In short; The Word HTML rendering engine doesn’t provide support for things like animated gifs (unless you are using Outlook as part of a Microsoft 365 subscription), advanced css formatting and HTML forms, accessibility and more.
To overcome this, there is the “View in Browser” command in Outlook but that still opens the message in the ancient Internet Explorer.
This guide explains how you can render the message in a browser of your choice like Microsoft Edge, Google Chrome or Firefox by a click of a button.
An additional benefit of opening the message in an Internet browser is that you have the printing options of the browser available to you and therefore also the option to only print your selection.
Examples
Before we start this procedure, let me show you some examples of the results you can achieve by using this macro.
Example 1 in Outlook | Example 1 in Browser | Example 2 in Outlook | Example 2 in Browser |
OpenInBrowser VBA macro
The OpenInBrowser macro allows you to open the selected message in a browser of your choice instead of the ancient Internet Explorer.
By default, the macro evaluates whether or not it can take the raw HTML of the message (for as little distortions as possible) or whether it has to take Outlook’s pre-rendered version.
Once it message is opened in the Internet browser of your choice, the message will display with various features and formatting which lack in Outlook such as animated gifs, print selection and the browser’s accessibility support.
Quick Install
Use the following instructions to configure the macro in Outlook;
- Download this code-file (
openinbrowser.zip
) or copy the code below. - Open the VBA Editor (keyboard shortcut ALT+F11)
- Extract the zip-file and import the
OpenInBrowser.bas
file via File-> Import…
If you copied the code, paste it into a new module. - Sign your code so you won’t get any security prompts and the macro won’t get disabled.
- Add a button for easy access to the macro or press ALT+F8 and select the macro you want to execute.
Add a button of the macro to the QAT for quick access to it.
Macro Code
The following code is contained in the zip-file referenced in the Quick Install. You can use the code below for review or manual installation.
Click in the area above and press CTR+A to select all. Press CTRL+C to copy the code.
Modifications
This macro allows for a couple of modifications which are explained in the “Set your variables” section at the top of the macro.
By default, the macro will only take the raw HTML of a message when there are no embedded images in the message itself. This usually is the case for newsletters since they load the images directly from the Internet instead of embedding them into the message.
Most importantly, you can define which browser to open the message with by editing the following line;
BrowserLocation = "C:\Program Files\Internet Explorer\iexplore.exe"
As you can see, I’ve left the default to Internet Explorer. This is because currently Internet Explorer is still the Internet browser which exists on all currently supported Windows versions.
Below are some default paths for common Internet browsers;
- Microsoft Edge
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
- Google Chrome
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
- Firefox
"C:\Program Files\Mozilla Firefox\firefox.exe"
- Opera
"C:\Users\%username%\AppData\Local\Programs\Opera\launcher.exe"