2 Quick Ways to Extract Email Addresses of All Outlook Contacts to a Plain Text File

At times, you need to extract the email addresses only of all your Outlook contacts to a Plain Text file. In this scenario, you can refer to this article. Here we will share 2 ways to get it in quick time.

Outlook supports users to export multiple contacts in a single text only file by the native “Save As” feature. By that means, all the contact information, including the full name, email addresses, company, job title, business addresses, etc. Yet, if you only want to export all contacts’ email addresses to a text file, it is sure that “Save As” cannot satisfy you. Hence, thereinafter, we’ll introduce you 2 means to get it.

Method 1: Copy to Text File after Removing Other Columns

  1. To begin with, open an Outlook contact folder.
  2. Then, click “View” > “Change View” > “List”.Change View to List
  3. Next, click the “Add Columns” button in “Arrangement” group on “View” tab.Add Columns
  4. In the popup dialog box, choose “E-mail fields” from the drop down list of “Select available columns from”.
  5. Then, select “E-mail 2” and “E-mail 3” and click “Add ->” button.Add "E-mail 2" and "E-mail 3" Columns
  6. Later, remove the other columns except “Full Name”, “E-mail”, “E-mail 2” and “E-mail 3”.Remove Unwanted Columns
  7. After that, click “OK” to return to contact list.
  8. Now, press “Ctrl + A” to select all and “Ctrl + C” to copy all.Select and Copy All Contacts
  9. Finally, create a new Text file and press “Ctrl + V” to paste the copied contacts. It will look like the following figure.Paste Copied Contacts to Plain Text File

Method 2: Extract Email Addresses Only to Text File via VBA

  1. At the very outset, press “Alt + F11” to access VBA editor in Outlook.
  2. Then, put the following VBA code into a module.
Dim objFileSystem As Object
Dim strTextFile As String
Dim objTextFile As Object

Sub ExtractEmailAddressesOnly2TextFile()
    Dim objStore As Outlook.Store
    strTextFile = "E:\Contact Email Addresses.txt"
    Set objFileSystem = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFileSystem.CreateTextFile(strTextFile, True)
    objTextFile.WriteLine ("Contact Email Addresses" & vbCrLf & vbCrLf)
    For Each objStore In Application.Session.Stores
        Call ProcessFolders(objStore.GetRootFolder.Folders)
    Shell ("notepad.exe " & strTextFile)
End Sub

Sub ProcessFolders(ByVal objFolders As Outlook.Folders)
    Dim objFolder As Outlook.Folder
    Dim i As Long
    Dim objContact As Outlook.ContactItem
    Dim strEmailAddresses As String
    Dim objSubFolder As Outlook.Folder
    For Each objFolder In objFolders
        If objFolder.DefaultItemType = olContactItem Then
           For i = objFolder.Items.Count To 1 Step -1
               If objFolder.Items(i).Class = olContact Then
                  Set objContact = objFolder.Items(i)
                  strEmailAddressInfo = objContact.FullName & vbTab & vbTab & objContact.Email1Address & ";" & objContact.Email2Address & ";" & objContact.Email3Address & vbCr
                  objTextFile.WriteLine (strEmailAddressInfo)
               End If
           If objFolder.Folders.Count > 0 Then
              Call ProcessFolders(objFolder.Folders)
           End If
        End If
End Sub

VBA Code - Extract Email Addresses of All Outlook Contacts to a Plain Text File

  1. Eventually, move cursor in the first subroutine and press “F5”.
  2. When macro finishes, a new Plain Text file will open, as shown in screenshot below.New Plain Text File

Dispose of Outlook File Corruption

Maybe you have ever suffered Outlook file damage alike. At the best, you’ve kept an updated Outlook data backup in hand, thus you can simply restore data from backups. However, at the worst, you have no backups and the internal repair tool fails, At that point, you have no choice but to repair Outlook file to get back your valuable data, such as by resorting to DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair sql and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.