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 variablesDim item As Outlook.MailItem
Dim sct As Outlook.Selection
Dim byt AsByte ' Get selected itemsSet sct = Application.ActiveExplorer.Selection
' Check if any items were selectedIf sct.Count > 0 Then ' Loop through selected itemsFor byt = 1 To sct.Count
' Set mail itemSet item = sct(byt)
' Open mail item
item.Display
Next byt
Else ' Return message
MsgBox "Please select any email!"
EndIfEndSub