Solved

Create a list of all of the email addresses from sent items in Outlook

Posted on 2014-11-05
4
161 Views
Last Modified: 2014-11-18
I want to create a mailing list from all of the emails that I have sent to collegues in the last few months.
Is there a way to extract only the email Names/addresses from Outlook/Exchange sent items?
0
Comment
Question by:AMixMaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 40426145
Hi, AMixMaster.

I can do it with an Outlook macro.  If that's acceptable, then I'll post the code and instructions for using it.
0
 

Author Comment

by:AMixMaster
ID: 40430640
That makes sense, please do!
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 40430748
Ok, here's the code.  Follow these instructions to add the code to Outlook.

1.  Start Outlook
2.  Press ALT+F11 to open the Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  If not already expanded, expand Modules
5.  Select an existing module (e.g. Module1) by double-clicking on it or create a new module by right-clicking Modules and selecting Insert → Module
6.  Copy the code from the code snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Click the diskette icon on the toolbar to save the changes
8.  Close the VB Editor
9. Run the macro CreateDistListFromSentItems

Sub CreateDistListFromSentItems()
    Const MACRO_NAME = "Create Distribution List from Sent Items"
    Dim olkFld As Outlook.MAPIFolder, _
        olkMsg As Object, _
        olkLst As Outlook.DistListItem, _
        olkRcp As Outlook.Recipient, _
        strNam As String, _
        intCnt As Integer
    strNam = InputBox("Enter a name for the new distribution list.", MACRO_NAME)
    If strNam = "" Then
        MsgBox "You did not enter a name for the distribution list.  Operation cancelled.", vbExclamation + vbOKOnly, MACRO_NAME
    Else
        Set olkLst = Application.CreateItem(olDistributionListItem)
        olkLst.DLName = strNam
        Set olkFld = Session.GetDefaultFolder(olFolderSentMail)
        For Each olkMsg In olkFld.Items
            If olkMsg.Class = olMail Then
                For Each olkRcp In olkMsg.Recipients
                    olkLst.AddMember olkRcp
                    intCnt = intCnt + 1
                Next
            End If
        Next
        olkLst.Save
        MsgBox "I created the list and added " & intCnt & " members to it.", cbi + vbOKOnly, MACRO_NAME
    End If
    Set olkFld = Nothing
    Set olkMsg = Nothing
    Set olkLst = Nothing
    Set olkRcp = Nothing
End Sub

Open in new window

0
 

Author Closing Comment

by:AMixMaster
ID: 40451378
Absolutely Perfect!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I didn’t use eM Client for long when I decided to swap to Outlook 2016. The reason for the switch is that it started asking for payment to continue some of its services after one month.   The problems I faced when I didn’t pay were:   I was not …
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question