• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Display the Recipient Email Address in the Sent Items Folder

Slipstick Systems

› Developer › Display the Recipient Email Address in the Sent Items Folder

Last reviewed on February 20, 2025     35 Comments

I'm frequently asked how to display the recipient's email address in the Sent Items folder. The answer is this macro, which adds a custom field containing the addresses the message was sent to. The custom address field is a text field and you can sort or group by it.

Recipient addresses

Note that when a message is sent to multiple people, all addresses will be entered in the field as one long string, as seen in this example.

/o=ExchangeLabs/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=43dfb970e3b54f85942d1348b58581e6-drcp;billy@domain.net;

Exchange server addresses are the x.500 address (as seen in the example above), not the SMTP address, however, you can use the Right() function to keep just the alias.

Public Sub GetRecipientAddress()
'http://slipstick.me/9vjgj
    Dim currentExplorer As Explorer
    Dim Selection As Selection
    Dim obj, objMail As Object
    Dim objProp As Outlook.UserProperty
    Dim strDomain
    Dim Recipients As Outlook.Recipients
    Dim recip As String
    Dim i
    Dim prompt As String
     
    Set currentExplorer = Application.ActiveExplorer
    Set Selection = currentExplorer.Selection
 
    On Error Resume Next
 
For Each obj In Selection
         Set objMail = obj
         strDomain = ""
Set Recipients = objMail.Recipients
  For i = Recipients.count To 1 Step -1
     recip$ = Recipients.item(i).Address
     
   ' To use only the alias from the x.500 address
 ' Exchange online
    'If InStr(1, LCase(recip), "/ou=") Then recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "-"))
    ' on prem
    'If InStr(1, LCase(recip), "/ou=") Then recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "recipients") - 13)

' Use semicolon separator if there is more than 1 address
     If i = 1 Then
         strDomain = strDomain & recip
     Else
         strDomain = strDomain & recip & "; "
     End If

  Next i
     Debug.Print strDomain
    ' Msgbox strDomain
  
         Set objProp = objMail.UserProperties.Add("Recipient Email", olText, True)
         objProp.Value = strDomain
         objMail.Save
  
        Err.Clear
    Next
  
    Set currentExplorer = Nothing
    Set obj = Nothing
    Set Selection = Nothing
End Sub

To write the address list to a new message for easy reading, replace the Set objProp = to objMail.Save lines with the following:

Set objMsg = Application.CreateItem(olMailItem)

 With objMsg
  .Body = strDomain
  .Display
End With

 

Add the field automatically

To add the recipient address field automatically, you need to use an ItemAdd macro. These macros need to be in ThisOutlookSession. To test, click in the Application_Startup macro and click Run then send a message.

Dim WithEvents olSent As Items
  
Private Sub Application_Startup()
   Dim NS As Outlook.NameSpace
   Set NS = Application.GetNamespace("MAPI")
   Set olSent = NS.GetDefaultFolder(olFolderSentMail).Items
   Set NS = Nothing
End Sub
  
Private Sub olSent_ItemAdd(ByVal Item As Object)
    ' Fromhttp://slipstick.me/1
    Dim objProp As Outlook.UserProperty
    Dim strDomain As String
    Dim Recipients As Outlook.Recipients
    Dim recip As String 'Outlook.Recipient
    Dim i
                   
strDomain = ""
Set Recipients = Item.Recipients
  For i = Recipients.count To 1 Step -1
     recip$ = Recipients.Item(i).Address
    ' Exchange online
    'If InStr(1, LCase(recip), "/ou=") Then recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "-"))
    ' on prem
    'If InStr(1, LCase(recip), "/ou=") Then recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "recipients") - 13)
     If i = 1 Then
         strDomain = strDomain & recip
     Else
         strDomain = strDomain & recip & "; "
     End If
  Next i
      
  Set objProp = Item.UserProperties.Add("Recipient Email", olText, True)
    objProp.Value = strDomain
    Item.Save
  
    Err.Clear
         
    Set objProp = Nothing
    Set Recipients = Nothing
         
 End Sub

How to use this macro

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor

More Information

Sort messages by Sender domain
How to display the sender's email address in Outlook
Read MAPI properties not exposed in Outlook's Object Model

Display the Recipient Email Address in the Sent Items Folder was last modified: February 20th, 2025 by Diane Poremsky
Post Views: 34

Related Posts:

  • Sort messages by Sender domain
  • Move email items based on a list of email addresses
  • Warn Before Sending: Checking Contact Categories
  • Warn Before Sending Messages to the Wrong Email Address

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
35 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Evan
June 13, 2024 4:21 pm

Hi Diane,   First off thanks so much for all the years you have contributing and maintaining this forum (sincere and immense appreciation for this).   Reaching out to see if you could provide VBA code that does the following:   Creates an outlook field to list all email addresses (the sender's and all the recipients' (to, cc, bcc)) included in an outlook item?   Ideally this would not include any .500 addresses and show only the external facing SMTP addresses. Would look for this field to be a keyword field. This would allow for a grouping of all messages involving any one specific email address (all messages sent to or from any one address).   The approach I had in mind was to use the following:   PR_CREATOR_SMTP_ADDRESS_W (0x5D0A001F)  to reference a clean “from address”   And using the Property accessor with the Recipient object to access the PR_SMTP_ADDRESS_W (0x39FE001F) of all the recipients   Would then concatenate the above strings with a semicolon between each SMTP email address.     Also, a second macro that utilizes the exact same code or references the result of the above; however, it includes a text function such that the result is only… Read more »

Last edited 1 year ago by Evan
0
0
Reply
Diane Poremsky
Author
Reply to  Evan
June 13, 2024 7:42 pm

Tweaking this macro to do that is possible... and I have one somewhere that does the domain.

0
0
Reply
David
May 4, 2021 8:33 pm

Hi Diane,

I had been searching all over for a solution to this and finally stumbled across your solution. I'm so glad I found your post.

One area of trouble I'm having is that the code in "ThisOutlookSession." Sometimes when I send email, the "Recipient Email" property gets populated and other times it doesn't.

When it doesn't, what's strange is that after emails are sent, the "Recipient Email" property gets populated but then a moment later it deletes itself. I can see it happen live if I add the "Recipient Email" column to my view. Any thoughts on how to correct this?

I've ensured that macros are running so that's not the issue. I added a "Stop" statement to the code so I could debug it, and even after going step by step, the property populates at the line "Item.Save" and then a moment later disappears. And that's before moving onto the next line of "Err.Clear."

David

0
0
Reply
David
May 4, 2021 8:26 pm

Hi Diane,

I had been searching all over for a solution to this and finally stumbled across your solution. I'm so glad I found your post.

One area of trouble I'm having is that the code in "ThisOutlookSession." Sometimes when I send email, the "Recipient Email" property gets populated and other times it doesn't.

When it doesn't, what's strange is that after emails are sent, the "Recipient Email" property gets populated but then a moment later it deletes itself. I can see it happen live if I add the "Recipient Email" column to my view. Any thoughts on how to correct this?

I've ensured that macros are running so that's not the issue. I added a "Stop" statement to the code so I could debug it, and even after going step by step, the property populates at the line "Item.Save" and then a moment later disappears. And that's before moving onto the next line of "Err.Clear."

David

0
0
Reply
Paul
August 4, 2016 10:49 am

Hi Diane
Apologies for my lack of understanding- I originally downloaded this from howtooutlook.com and noticed your address in the script. I have it running, but it shows the senders email address- which isn't any use to me in sent items. I'm trying to see the actual email address of where it was sent to and so want to show the column in the sent items- is this possible with a tweak? I think I may have missed something as this page is headed as though it should do as I need it to. Thanks in advance

0
0
Reply
Ben
April 15, 2016 4:29 pm

I tried following the instructions but it still shows the long exchange data in the recipient address field.

0
0
Reply
Diane Poremsky
Author
Reply to  Ben
April 15, 2016 4:50 pm

Did you remove the ' from this line:
' If InStr(1, LCase(recip), "/ou=") Then recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "recipients") - 13)

it's still leave an ugly alias: 43dfb970e3b54f85942d1348b58581e6-drcp but drops the rest of the x500 junk. By improving the formula, Right(recip, Len(recip) - InStr(1, LCase(recip), "recipients") - 13), you could get it down to just the alias.

0
0
Reply
Diane Poremsky
Author
Reply to  Diane Poremsky
April 15, 2016 5:00 pm

Replacing the line that removes most of the x500 with this works her (none of my aliases have - in them, so there is no risk of error)
If InStr(1, LCase(recip), "/ou=") Then
recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "recipients") - 13)
recip = Right(recip, Len(recip) - InStr(1, LCase(recip), "-"))
End If

0
0
Reply
chandrasekhar
January 25, 2016 8:31 pm

HI, I have mail with table and some html elements such as hyperlinks etc. I would like to open the mail and when i run the macro, it has to create an appointment with the same html format (tables as it is and hyperlink text message). I tried it in 2013 and 2010 versions. It is converting into plain text. Any advise.

Also, i have to add an additional text in the appointment along the with the message from outlook. Let' say: "Hi" & mail body with html formats (Tables, hyperlinks).

0
0
Reply
williamlambton
June 30, 2014 8:44 am

I have put an item at the bottom here:

https://forums.slipstick.com/threads/86266-customised-to-cc-bcc-and-have-replies-sent-to-columns-in-message-lists/.

That's my own thread dated 10th July 2011 (eleven), though I first started hunting for this facility in 2010 (I think). Very good to see the question at last addressed!

0
0
Reply
Kristian
March 28, 2014 10:23 am

Works like a charm.

Thank you very much Diane!

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 31 Issue 3

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Use Classic Outlook, not New Outlook
  • How to Remove the Primary Account from Outlook
  • Mail Templates in Outlook for Windows (and Web)
  • How to Hide or Delete Outlook's Default Folders
  • Reset the New Outlook Profile
  • Adjusting Outlook's Zoom Setting in Email
  • Disable "Always ask before opening" Dialog
  • Change Outlook's Programmatic Access Options
  • This operation has been cancelled due to restrictions
  • Syncing Outlook with an Android smartphone
  • Error Opening iCloud Appointments in Classic Outlook
  • Opt out of Microsoft 365 Companion Apps
  • Mail Templates in Outlook for Windows (and Web)
  • Urban legend: Microsoft Deletes Old Outlook.com Messages
  • Buttons in the New Message Notifications
  • Move Deleted Items to Another Folder Automatically
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Error Opening iCloud Appointments in Classic Outlook

Opt out of Microsoft 365 Companion Apps

Mail Templates in Outlook for Windows (and Web)

Urban legend: Microsoft Deletes Old Outlook.com Messages

Buttons in the New Message Notifications

Move Deleted Items to Another Folder Automatically

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2026 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment