Solved

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

Posted on 2014-11-05
4
159 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
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…

740 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