How to Set the Default Font for the Body of Contact, Appointment and Task via VBA

Outlook has no native feature to set the default font for the body of contact, appointment and task item. Thus, if you want to specify the font, you can resort to the method introduced in this article.

Like the email, Outlook appointment, task and contact also have the body field, in which we can fill in the item details. However, Outlook only permits users to set the default font used in the email body. If you would like to specify the font in the body of contact, appointment or task, you have to seek other means, such as third party add-ins or Outlook VBA. Here we will elaborately teach you how to use VBA to get it. Read on to learn the detailed steps and corresponding VBA codes.

Set the Default Font for the Body of Contact Appointment and Task

Set the Default Font for the Body of Appointment, Task and Contact

  1. At the very outset, start your Outlook program.
  2. Then press “Alt + F11” key buttons to launch Outlook VBA editor.
  3. In the popup window, you need to open the “ThisOutlookSession” project.
  4. Subsequently, copy the following VBA codes into this project window.
Public WithEvents objInspectors As Outlook.Inspectors
Public WithEvents objInspector As Outlook.Inspector

Public Sub Application_Startup()
    Set objInspectors = Outlook.Application.Inspectors
End Sub

Public Sub objInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
    Set objInspector = Inspector
End Sub

Public Sub objInspector_Activate()
    Dim objCurrentItem As Object
    Dim objCurrentInspector As Outlook.Inspector
    Dim objWordDocument As Word.Document
    Dim objWordSelection As Word.Selection
 
    Set objCurrentItem = objInspector.CurrentItem
    Set objCurrentInspector = objCurrentItem.GetInspector
    Set objWordDocument = objCurrentInspector.WordEditor
    Set objWordSelection = objWordDocument.Application.Selection
 
    'You change the font as per your preference
    Select Case objCurrentItem.Class
           Case olContact
                With objWordSelection.Font
                     .Name = "Segoe Script"
                     .ColorIndex = wdRed
                     .Size = 8
                     .Bold = True
                End With
           Case olAppointment
                With objWordSelection.Font
                     .Name = "Comic Sans MS"
                     .ColorIndex = wdBlue
                     .Size = 9
                     .Bold = False
                End With
           Case olTask
                With objWordSelection.Font
                     .Name = "MV Boli"
                     .ColorIndex = wdGreen
                     .Size = 10
                     .Bold = True
                End With
   End Select
End Sub

VBA Codes- Set the Default Font for the Body of Contact, Appointment and Task

  1. After that, you need to sign this code.
  • First, create a digital certificate by Digital Certificates for VBA Projects.
  • Then assign this certificate to the new macro.
  1. Later, you could change your Outlook macro settings to permit the digitally signed macros.
  2. Finally you start your Outlook to activate the new VBA project. From now on, when you create a new contact, appointment or task, body will use its default font, like the following screenshot:Default Font for the Body of Contact, Appointment and Task

Protect Your PST Data against Corruption

Due to the fact that Outlook PST file is prone to error and corruption, you have to pay much attention to PST protections. For instance, you should beware of emails from unknown sources in that they may be malicious emails with viruses. Once your PST file gets infected, you have to recur to a reputable and well-proven fix tool, such as DataNumen Outlook Repair, which can repair PST file like a breeze.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including fix SQL Server and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.