Solved

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

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
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.
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…

770 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