Thread: Email adresses
View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans
 
Posts: n/a
Default Email adresses

If you have Word 2002 or 2003 you can do this without code ...

Press Alt+F9 to toggle field codes
Press Ctrl+F to get the Find Dialog
In the Find what box enter ^d hyperlink "mailto
Check the "Highlight all Items" checkbox
Click on "Find All"
Click on Close
Press Alt+F9 to toggle field codes off
Press Ctrl+C to copy all the e-mail hyperlinks found
Press Ctrl+N to open a new document
Press Ctrl+V to paste the e-mail addresses

--
Enjoy,
Tony


"Doug Robbins - Word MVP" wrote in message
...
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

Application.ScreenUpdating = False

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

"fsa" wrote in message
...
i have a text from my supplier and it includes hundreds of email adresses
with lots of text and i dont want to select all email adresses
one-by-one.Can
Word have an option like selecting all the email adresses on a word
document?