For reasons Microsoft has never fully articulated, there is currently no way to automatically zoom the contents of an email when it is displayed in the preview pane of Outlook 2016. Readers can use the zoom controls manually to adjust the size of the text on display, but there is no way to set the zoom size permanently in the preview pane. For those of us with less than perfect eyesight, this can be particularly annoying.
Likewise, when users double-click an email in Outlook 2016 to open the message inside its own window, there is no configuration or setting available that will automate an increase in the overall size of the text being displayed. Again, readers may manually adjust the zoom settings using the controls, but to automate the process we have to resort to a VBA macro. Specifically, we will have to resort to a VBA macro that is authorized with a self-signed digital certificate.
SEE: Mobile device security: A guide for business leaders (Tech Pro Research)
This how-to tutorial shows you how to create a VBA macro that will automatically change the zoom settings for email displayed in Microsoft Outlook 2016. This macro will only work for emails that users open with a double-click–it will not work in the preview pane. In addition, it is assumed that you have changed configuration settings and established a self-signed digital certificate as suggested in How to create a self-signed digital certificate for VBA macros in Office 365.
Creating the macro
Creating a basic VBA macro using Microsoft Office developer tools requires a significant number of steps. The first step is to open the application specific to your macro. In this case, that would be Outlook 2016.
If the Developer tab is not listed in Outlook’s tab menu, you will have to add it. Click File | Options | Customize Ribbon. Scroll down the right navigation pane, as shown in Figure A, until you find the Developer checkbox. Place a check in the box and click OK.
Back in Outlook, click the Developer tab and then click the Visual Basic button to start your VBA session. As shown in Figure B, there is not much to look at until you start a project.
Click the plus (+) signs on the folders to expand the tree and double-click the ThisOutlookSession entry. For the next step, we need to add appropriate reference libraries to our macro. Click the Tools menu item and then click References. Find these entries in the list provided (Figure C) and place checkmarks in each.
- Visual Basic for Applications
- Microsoft Outlook 16.0 Object Library
- OLE Automation
- Microsoft Office 16.0 Object Library
- Microsoft Word 16.0 Object Library
In Word and Excel, users can record their actions and Visual Basic will produce usable code that can then be edited and saved as a macro. Unfortunately, VBA macros for Outlook cannot be recorded in this way and more coding prowess is required. The example Outlook VBA macro, shown in Figure D, was written by Matt Pilz and can be accessed on his personal website.
Once you have copied and pasted the macro into the editor, it is time to apply the self-certified digital certificate we created just for such occasions. Click the Tools tab again and then click the Digital Signature menu item. Click the Choose button as shown in Figure E, select the appropriate certificate, and then click OK.
Save your VBA project by clicking the Save button and then close the VBA editor. Finally, close Outlook, where you will be asked if you want to Save again, which you do.
The next time you open Outlook (Figure F), you will see an alert that warns you of the macro’s existence. Click the Trust all documents from this publisher button, and the macro will be allowed to run from that point forward.
With the VBA macro active and authorized, whenever you double-click an email it will open like normal, only the text will be displayed at a zoom level of 175%. You can adjust that percentage in the VBA code, if it is not set to a level you like.
Do you regularly use VBA macros? Will you try this one for Outlook? Share your thoughts and opinions with your peers at TechRepublic in the discussion thread below.