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
Thank you very much for saving precious time. Thanks a lot…………….
updated code from Nada Raglan works a treat. thanks
run time error 5174
Не работает ((
Пишет – Поле “Найти” сождержит неверный шаблон поиска
Что делать?
Super helpful – saved me HOURS! Thank you!
Thanks. This is for emails. How do we extract phone numbers from word texts? cheers
Found this today and it’s so helpful!! Thank you so much for sharing!! And thank you @Nada Raslan!
for get any special character use this
for example i want to get email with ‘$’
you just write it like that
[A-z,0-9,\.,\$]{1,}\@[A-z,0-9,\.]{1,}
for auther axample i want this ‘-‘
[A-z,0-9,\.,\-]{1,}\@[A-z,0-9,\.,\-]{1,}
and so on
good luck for evryone
addresses in this document have been highlighted. Close the dialog box.
Its not happening
doesn’t get emails with “-“
None of the methods is working. I have Word 365. Maybe this is the problem
So helpful, this was exactly what I needed as all of our addresses have a period in them.
nada is a hero i mean was very annoying with the code in the article doesn’t get emails with full stop .
Hero
Thank you so much for the detailed illustrated instructions. It made my life so much easier.
For the first method, please use this instead: “[A-z,0-9,.,_,-]{1,}\@[A-z,0-9,\.]{1,}”
It includes periods, underscores, and hyphens in the email names being exported.
The search text in the article worked, but excluded emails such as abcd.efgh@domain or abcd_efgh@domain for example.
Really Helpful article, Many a time people hide hard earn knowledge but it may help really sometime to hard working people. Thanx a lot from india!