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
- To begin with, open an Outlook contact folder.
- Then, click “View” > “Change View” > “List”.
- Next, click the “Add Columns” button in “Arrangement” group on “View” tab.
- In the popup dialog box, choose “E-mail fields” from the drop down list of “Select available columns from”.
- Then, select “E-mail 2” and “E-mail 3” and click “Add ->” button.
- Later, remove the other columns except “Full Name”, “E-mail”, “E-mail 2” and “E-mail 3”.
- After that, click “OK” to return to contact list.
- Now, press “Ctrl + A” to select all and “Ctrl + C” to copy all.
- Finally, create a new Text file and press “Ctrl + V” to paste the copied contacts. It will look like the following figure.
Method 2: Extract Email Addresses Only to Text File via VBA
- At the very outset, press “Alt + F11” to access VBA editor in Outlook.
- 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) Next objTextFile.Close 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 Next If objFolder.Folders.Count > 0 Then Call ProcessFolders(objFolder.Folders) End If End If Next End Sub
- Eventually, move cursor in the first subroutine and press “F5”.
- When macro finishes, a new Plain Text file will open, as shown in screenshot below.
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.
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