2 Go to Developer's tab > click on "Visual Basic" button or hit Alt + F11.
3 Go to Insert tab > click on "Module" or hit M.
4 Copy the VBA code from below.
5 Paste the code in the newly created module.
6 Go to Run tab > click on "Run Sub/UserForm" or hit F5.
7 That's it!
Advertisement
Code
'==========================================
' Open Selected Mail Items
'==========================================
Sub openSelectedMailItems()
' Set variables
Dim item As Outlook.MailItem
Dim sct As Outlook.Selection
Dim byt As Byte
' Get selected items
Set sct = Application.ActiveExplorer.Selection
' Check if any items were selected
If sct.Count > 0 Then
' Loop through selected items
For byt = 1 To sct.Count
' Set mail item
Set item = sct(byt)
' Open mail item
item.Display
Next byt
Else
' Return message
MsgBox "Please select any email!"
End If
End Sub