Microsoft Outlook – Keep zoom setting when reading emails

Open up Outlook
Press Alt and F11

Navigate to:
Project1 | Microsoft Outlook Objects | ThisOutlookSession

Paste the code below in (about 52 lines)

'  --- Start Copy Here ---
'*******************************************************************
'* The code below changes the zoom for reading and writing e-mails *
'* Written By: Dan Thomas                                          *
'* Date: 30th Oct 2012                                             *
'*******************************************************************
Option Explicit
' For more information on the below varibles please see http://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.outlook.aspx
Dim WithEvents objOLInspectors As Outlook.Inspectors   'Define the Outlook Inspectors varable
Dim WithEvents objOLMailItem As Outlook.MailItem       'Define the Outlook Mail Item varible
Dim WithEvents objOLOpenInspector As Outlook.Inspector 'Define the Outlook Inspector varable

Private Sub Application_Startup()
' Set the Inspectors object to the objOLInspectors varible at start of application
' This will generate a warning to ask if you want to enable Macros when starting Outlook within Airbus
Set objOLInspectors = Application.Inspectors
End Sub

Private Sub Application_Quit()
' Sets all the varibles to nothing when quitting outlook
Set objOLInspectors = Nothing
Set objOLOpenInspector = Nothing
Set objOLMailItem = Nothing
End Sub

Private Sub objOLInspectors_NewInspector(ByVal Inspector As Inspector)
' This sets the objects to varibles when opening mails
If Inspector.CurrentItem.Class = olMail Then
Set objOLMailItem = Inspector.CurrentItem
Set objOLOpenInspector = Inspector
End If
End Sub

Private Sub objOLOpenInspector_Close()
' Clears the varibles when closing e-mails
Set objOLMailItem = Nothing
End Sub

Private Sub objOLOpenInspector_Activate()

'For Office 2007
'Dim wrdDoc As Word.Document

'For Office 2010
Dim wrdDoc As Object

' For the below to work you have to go to Tools|References... and make sure the Microsoft Office 14.0 Object Library has been selected
Set wrdDoc = objOLOpenInspector.WordEditor ' Sets the wrdDoc Varible to the Word Editor object

' Set the number at the end of this line for zoom amount
wrdDoc.Windows(1).Panes(1).View.Zoom.Percentage = 145
End Sub
'  --- End Copy Here ---

Click save
Check that Tools|References... and make sure the Microsoft Office 14.0 Object Library has been selected
If you have Outlook 2007 you may have to activate the line that says Dim wrdDoc As Word.Document
and rem the line that says Dim wrdDoc As Object

Close outlook and restart

Leave a Reply

Your email address will not be published. Required fields are marked *