Getting started with Microsoft Outlook VBA - Hello World


Open Outlook
File > Options
Customise the Ribbon
Main Tab > Developer > OK
Developer
Visual Basic
Insert
Module
  Sub sbHelloWorld()
    MsgBox "HelloWorld"
  End Sub
  
Run > Reset
File > Save
Run > Run Sub
As at 08:29 18th December 2022 Microsoft 365 Outlook Version 2211 (Build 15831.20208 Click-to-Run)
This macro runs the first time through. On the second time through after closing and opening Outlook a meesage is displayed.
  The macros in this project are disabled. 
  Please refer to the online help or documention of the 
  host application to determine how to enable macros.
  
Macro Security
Macro Settings
Enable all macros (Not recommended; potentially dangerous code can run)
OK
Developer
Visual Basic
Run > Run Sub

The code runs as expected.


.