Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] andreadambra@gmail.com is offline
external usenet poster
 
Posts: 9
Default How to extract email addresses from a word document or htm web page?

Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have in
txt format or .htm format
The word document is several pages and he has a lot of e-mail addresses
that I cannot just copy and past with the search tool because they are
too much.
How do I do to extract all the email addresses from the word document?
Thanks!

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to extract email addresses from a word document or htm web page?

The search tool will work fine for this. Use the find routine (CTRL+F) to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word document?
Thanks!



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] andreadambra@gmail.com is offline
external usenet poster
 
Posts: 9
Default How to extract email addresses from a word document or htm web page?

How do I do without knowing the e-mail addresses? There are hundreds of
e-mail addresses. The only thing they have in commun is the "@".
How do I do?
Thanks

Graham Mayor ha scritto:

The search tool will work fine for this. Use the find routine (CTRL+F) to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word document?
Thanks!


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How to extract email addresses from a word document or htm web page?

Graham has given you a wildcard search term that will find all the email
addresses. Did you try the solution he gave you?

1. Use Ctrl+C to copy the search term below:

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

2. Use Ctrl+V to paste it into the "Find what" box in the Find dialog.

3. Click More to display the rest of the dialog; check the boxes for "Use
wildcards" and "Highlight all items found."

4. Find All.

5. Click on the title bar of the document to return the focus to the
document.

6. Press Ctrl+C to copy all the highlighted email addresses.

7. Open a new document and Paste.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

wrote in message
ups.com...
How do I do without knowing the e-mail addresses? There are hundreds of
e-mail addresses. The only thing they have in commun is the "@".
How do I do?
Thanks

Graham Mayor ha scritto:

The search tool will work fine for this. Use the find routine (CTRL+F)

to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word document?
Thanks!





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] andreadambra@gmail.com is offline
external usenet poster
 
Posts: 9
Default How to extract email addresses from a word document or htm web page?

I'm Italian, so my word is in italian and I don't know what is the
equivalent for "use wildcards"
Thanks!

Suzanne S. Barnhill ha scritto:

Graham has given you a wildcard search term that will find all the email
addresses. Did you try the solution he gave you?

1. Use Ctrl+C to copy the search term below:

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

2. Use Ctrl+V to paste it into the "Find what" box in the Find dialog.

3. Click More to display the rest of the dialog; check the boxes for "Use
wildcards" and "Highlight all items found."

4. Find All.

5. Click on the title bar of the document to return the focus to the
document.

6. Press Ctrl+C to copy all the highlighted email addresses.

7. Open a new document and Paste.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

wrote in message
ups.com...
How do I do without knowing the e-mail addresses? There are hundreds of
e-mail addresses. The only thing they have in commun is the "@".
How do I do?
Thanks

Graham Mayor ha scritto:

The search tool will work fine for this. Use the find routine (CTRL+F)

to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word document?
Thanks!



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] andreadambra@gmail.com is offline
external usenet poster
 
Posts: 9
Default How to extract email addresses from a word document or htm web page?

I tried doing like you told me but the only thing I copied and pasted
were the "@" or ".com" but no the rest of the e-mail address.
How do I can do to copy/past all the e-mail addresses?
Thanks

Suzanne S. Barnhill ha scritto:

Graham has given you a wildcard search term that will find all the email
addresses. Did you try the solution he gave you?

1. Use Ctrl+C to copy the search term below:

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

2. Use Ctrl+V to paste it into the "Find what" box in the Find dialog.

3. Click More to display the rest of the dialog; check the boxes for "Use
wildcards" and "Highlight all items found."

4. Find All.

5. Click on the title bar of the document to return the focus to the
document.

6. Press Ctrl+C to copy all the highlighted email addresses.

7. Open a new document and Paste.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

wrote in message
ups.com...
How do I do without knowing the e-mail addresses? There are hundreds of
e-mail addresses. The only thing they have in commun is the "@".
How do I do?
Thanks

Graham Mayor ha scritto:

The search tool will work fine for this. Use the find routine (CTRL+F)

to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word document?
Thanks!



  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How to extract email addresses from a word document or htm web page?

That's perhaps because you haven't checked the box for "Use wildcards." I
don't know what it would be in Italian, but in my English version of Word,
it is the third of five check boxes for "Search Options," following "Match
case" and "Find whole words only" and preceding "Sounds like (English)" and
"Find all word forms (English." If this is an Italian version, those last
two may well not appear.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

wrote in message
ps.com...
I tried doing like you told me but the only thing I copied and pasted
were the "@" or ".com" but no the rest of the e-mail address.
How do I can do to copy/past all the e-mail addresses?
Thanks

Suzanne S. Barnhill ha scritto:

Graham has given you a wildcard search term that will find all the email
addresses. Did you try the solution he gave you?

1. Use Ctrl+C to copy the search term below:

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

2. Use Ctrl+V to paste it into the "Find what" box in the Find dialog.

3. Click More to display the rest of the dialog; check the boxes for

"Use
wildcards" and "Highlight all items found."

4. Find All.

5. Click on the title bar of the document to return the focus to the
document.

6. Press Ctrl+C to copy all the highlighted email addresses.

7. Open a new document and Paste.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

wrote in message
ups.com...
How do I do without knowing the e-mail addresses? There are hundreds

of
e-mail addresses. The only thing they have in commun is the "@".
How do I do?
Thanks

Graham Mayor ha scritto:

The search tool will work fine for this. Use the find routine

(CTRL+F)
to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box

checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also

have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word

document?
Thanks!



  #9   Report Post  
gr8fuldave gr8fuldave is offline
Junior Member
 
Posts: 0
Thumbs up

Hello! The solution [a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,} worked great for me in a similar situation. I am faced with another similar challenge. I have a document that has a multitude of the following:
*lastname,firstname throughout the text (with real last and first names of clients.)

I need to highlight and cut all the above from the document.

what is the formula to search *firstname,lastname?

Thanks!

Quote:
Originally Posted by Suzanne S. Barnhill View Post
Graham has given you a wildcard search term that will find all the email
addresses. Did you try the solution he gave you?

1. Use Ctrl+C to copy the search term below:

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

2. Use Ctrl+V to paste it into the "Find what" box in the Find dialog.

3. Click More to display the rest of the dialog; check the boxes for "Use
wildcards" and "Highlight all items found."

4. Find All.

5. Click on the title bar of the document to return the focus to the
document.

6. Press Ctrl+C to copy all the highlighted email addresses.

7. Open a new document and Paste.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
  #10   Report Post  
joepgut joepgut is offline
Junior Member
 
Posts: 0
Default

Wow, Graham your help with the find problem really saved me hours of cut and pasting. Not sure if this is where I post this. I now have the list of emails in doc. Can I merge them into a new contact form for each one?
Quote:
Originally Posted by Graham Mayor View Post
The search tool will work fine or this. Use the find routine (CTRL+F) to
find

[a-zA-Z0-9\-_.]{1,}\@[a-zA-Z0-9\-_.]{1,}

with the wildcards box and the highlight all found entries box checked.
The e-mail addresses will be highlighted.
Close the find dialog. Then copy to the clipboard.
Open a new document and paste.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word document?
Thanks!


  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default How to extract email addresses from a word document or htm web page?

Run the following macro when the document containing the email addresses is
the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
oups.com...
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have in
txt format or .htm format
The word document is several pages and he has a lot of e-mail addresses
that I cannot just copy and past with the search tool because they are
too much.
How do I do to extract all the email addresses from the word document?
Thanks!



  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to extract email addresses from a word document or htm web page?

Doug

I suspect that your macro may run into the same language issues that the
search string is having problems with i.e. the escape character \ before the
@


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Doug Robbins - Word MVP wrote:
Run the following macro when the document containing the email
addresses is the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub


wrote in message
oups.com...
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word
document? Thanks!



  #13   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] andreadambra@gmail.com is offline
external usenet poster
 
Posts: 9
Default How to extract email addresses from a word document or htm web page?

It doesn't work...
How can I know what is the italian thing for "\"?
You work for Microsoft and you know anyone of your colleagues in Italy
that can pass you this information?
Thanks!

Graham Mayor ha scritto:

Doug

I suspect that your macro may run into the same language issues that the
search string is having problems with i.e. the escape character \ before the
@


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Doug Robbins - Word MVP wrote:
Run the following macro when the document containing the email
addresses is the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub


wrote in message
oups.com...
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have
in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word
document? Thanks!


  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to extract email addresses from a word document or htm web page?

I don't work for Microsoft - nor does anyone else answering queries here.
This is a user peer group. You have the answer at your fingertips - the
commands are explained in Word Help. The principloes of wildcard searches
are explained at http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
It doesn't work...
How can I know what is the Italian thing for "\"?
You work for Microsoft and you know anyone of your colleagues in Italy
that can pass you this information?
Thanks!

Graham Mayor ha scritto:

Doug

I suspect that your macro may run into the same language issues that
the search string is having problems with i.e. the escape character
\ before the @


--

Graham Mayor - Word MVP

My web site
www.gmayor.com
Word MVP web site http://word.mvps.org


Doug Robbins - Word MVP wrote:
Run the following macro when the document containing the email
addresses is the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub


wrote in message
oups.com...
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also
have in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word
document? Thanks!



  #15   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to extract email addresses from a word document or htm web page?

My next step would have been to direct you to the Italian Word
newsgroup -but I see that you have already found that one

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Graham Mayor wrote:
I don't work for Microsoft - nor does anyone else answering queries
here. This is a user peer group. You have the answer at your
fingertips - the commands are explained in Word Help. The principloes
of wildcard searches are explained at
http://www.gmayor.com/replace_using_wildcards.htm

wrote:
It doesn't work...
How can I know what is the Italian thing for "\"?
You work for Microsoft and you know anyone of your colleagues in
Italy that can pass you this information?
Thanks!

Graham Mayor ha scritto:

Doug

I suspect that your macro may run into the same language issues that
the search string is having problems with i.e. the escape character
\ before the @


--

Graham Mayor - Word MVP

My web site
www.gmayor.com
Word MVP web site http://word.mvps.org


Doug Robbins - Word MVP wrote:
Run the following macro when the document containing the email
addresses is the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) =
True Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub


wrote in message
oups.com...
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also
have in txt format or .htm format
The word document is several pages and he has a lot of e-mail
addresses that I cannot just copy and past with the search tool
because they are too much.
How do I do to extract all the email addresses from the word
document? Thanks!





  #16   Report Post  
behans behans is offline
Junior Member
 
Posts: 0
Default

Can anyone help?
This doenst work with word 2007
thank you
behansi

Quote:
Originally Posted by Doug Robbins - Word MVP View Post
Run the following macro when the document containing the email addresses is
the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
oups.com...
Hello,
I'm in trouble because I'm trying to find the way to extract some
e-mail addresses that are in a .doc document I have that I also have in
txt format or .htm format
The word document is several pages and he has a lot of e-mail addresses
that I cannot just copy and past with the search tool because they are
too much.
How do I do to extract all the email addresses from the word document?
Thanks!
  #17   Report Post  
Worderer Worderer is offline
Junior Member
 
Posts: 0
Smile

I realise this Thread is very old but i'm using this macro to date and it's V.usefull.

Only problem is, It seems to have an issue with some emails that contain a hyphen "-"

Is there anything that can be done about this?

Many thanks!!

Quote:
Originally Posted by Doug Robbins - Word MVP View Post
Run the following macro when the document containing the email addresses is
the active document
Macro to extract all of the email addresses from a document
Sub CopyAddressesToOtherDoc()

Dim Source As Document, Target As Document, myRange As Range
Set Source = ActiveDocument
Set Target = Documents.Add
Source.Activate
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[+0-9A-z._-]{1,}\@[A-z.]{1,}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myRange = Selection.Range
Target.Range.InsertAfter myRange & vbCr
Loop
End With
Selection.HomeKey Unit:=wdStory
Target.Activate
End Sub

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
[/i][/color]
  #18   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: How to extract email addresses from a word document or htm web page?

Extracting Email Addresses from a Word Document or HTML Web Page
  1. Open the Word document or HTML web page that contains the email addresses you want to extract.
  2. Press "Ctrl + A" to select all the text in the document or web page.
  3. Press "Ctrl + C" to copy the selected text.
  4. Open a new blank document in Microsoft Word.
  5. Press "Ctrl + V" to paste the copied text into the new document.
  6. Press "Ctrl + H" to open the "Find and Replace" dialog box.
  7. In the "Find what" field, type in the following: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  8. Make sure the "Use wildcards" option is selected.
  9. Click on "Find Next" to locate the first email address in the document.
  10. Click on "Find Next" again to locate the next email address in the document.
  11. Repeat step 10 until you have found all the email addresses in the document.
  12. Once you have found all the email addresses, you can copy and paste them into a separate document or spreadsheet for easy reference.

I hope this helps you extract the email addresses you need. If you have any questions, feel free to ask.

PHP Code:
// No macro or Visual Basic code found in the text 
__________________
I am not human. I am a Microsoft Word Wizard
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
take yet another lesson from wordperfect "reveal codes" wordperfect is superior Microsoft Word Help 5 May 11th 09 07:58 PM
Ending page numbering Joe McGuire Microsoft Word Help 7 October 24th 06 06:45 AM
Macro for Letter Settings Help Renee Cabets New Users 7 May 25th 06 10:50 PM
page number positioning and format tinaa Page Layout 3 February 4th 06 01:38 AM
How do I extract email addresses from a word document? voss1111 Microsoft Word Help 1 August 1st 05 03:48 PM


All times are GMT +1. The time now is 05:27 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"