Solved

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

Posted on 2014-11-05
4
142 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
Comment Utility
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
Comment Utility
That makes sense, please do!
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
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
Comment Utility
Absolutely Perfect!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today, security is a big concern in an organization to prevent sensitive data leakage. In Outlook you can secure your Outlook items (emails, calendars, contacts and other stuff) using various techniques like by marking item as private, or you can pu…
I tend toward trying the newest hardware and software.  Thiss sometimes works out to my benefit, and sometimes not.  Because I downloaded and installed Android 5.x (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.htm…
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
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, fr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now