In this article, we will introduce you 2 ways to extract all email addresses in a Word document and concatenate them for batch processing.
Now and then, you may have to email to multiple persons at one time. However, things can get a little tricky when their addresses are scattering around a long document in pages. To navigate the whole document and find them one by one can be time-consuming. It is why we want to show you the quick way to extract all of them in one move for batch processing in your mail box.
Method 1: Use “Find and Replace” Option
- First and foremost, open the document containing email addresses.
- Then we start by clicking “Home” tab.
- Next choose to click the upside-down triangle on “Find” icon.
- On the drop-down list, choose “Advanced Find”.
- Now you will have the “Find and Replace” dialog box open. Ensure the “Find” tab is on and enter “[A-z,0-9]{1,}\@[A-z,0-9,\.]{1,}” into the “Find what” text box.
- Next click “More” to view more options.
- Then check “Use wildcards” box under “Search Options”.
- Click “Find In” button and select “Main Document”.
- Now you can see all the email addresses in this document have been highlighted. Close the dialog box.
- Next click “Copy” in “Clipboard” group under “Home” tab.
- Now create a new Word document.
- Right click on the new one and choose “Keep Text Only”. You shall see all email addresses are pasted there in column.
- Then click “Replace” in “Editing” group under “Home” tab.
- In “Under “Replace” tab, enter “^p” and “;” in “Find what” and “Replace with” text boxes respectively.
- And remember to clear the “Use wildcards” box.
- Then click “Replace All” button. Word will tell you how many replacements it has made and you can close all open boxes. On the document are email addresses separated by semicolons.
- What you need do lastly is to copy these addresses to your mail box and send the same information for all the receivers at once.
Method 2: Use VBA Codes
- Firstly, press “Alt+F11” to open the VBA editor.
- Then on the editing area, paste the following codes:
Sub ExtractAllEmailAddressesFromDocument() Dim strEmailAddresses As String ' Find all email addresses in a document,and Extract them. With ActiveDocument.Range With.Find .ClearFormatting .Replacement.ClearFormatting .Text = "[A-z,0-9]{1,}\@[A-z,0-9,\.]{1,}" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute End With Do While .Find.Found strEmailAddresses = strEmailAddresses & .Text & ";" .Collapse wdCollapseEnd .Find.Execute Loop End With ' Open a new document to paste the email addresses. If strEmailAddresses <> "" Then Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=0 ActiveDocument.Range.Text = strEmailAddresses End If End Sub
- Next hit “Run” button.
You will then have another new document with all the email addresses there, separated by semicolons. And you can start using them for batch processing in mail box.
Seize the Time to Retrieve Damaged Files
True, you can always find some surprises through working with Word. While you are amazed by its capabilities, you should watch out for the possible crashes that Word can suffer. On one hand, it stops your work. On the other hand, an even greater threat can prompt when Word collapses. And by greater threat we mean your compromised files and irreplaceable data.
Therefore, we keep suggesting you to make backups and most importantly, getting hold of a program to repair Word damage so you won’t waste time fussing around.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xls problem fix tool and pdf repair software products. For more information visit www.datanumen.com
Leave a Reply