Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-11-05
4
Medium Priority
?
175 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
  • 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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 …
Suggested Courses

916 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