#1   Report Post  
Posted to microsoft.public.word.docmanagement
fsa
 
Posts: n/a
Default Email adresses

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?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
 
Posts: n/a
Default Email adresses

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?



  #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?





  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Email adresses

If the email addresses are not hyperlinks, you would have to run autoformat
first to make them so.

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
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


"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?



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

Good point. I hadn't thought of that. I just cut and pasted a post I had
made somewhere else earlier in the day.

For completeness, precede my instructions with ..

Ctrl+A
Format Autoformat OK

And follow them with ..

Ctrl+F6 to switch back to the original document
Ctrl+Z to undo the autoformatting

--
Enjoy,
Tony


"Graham Mayor" wrote in message
...
If the email addresses are not hyperlinks, you would have to run

autoformat
first to make them so.

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
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


"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?







  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Email adresses

You would also have to check the autoformat options to ensure that the
convert hyperlinks option is checked - it might not be
With so many steps, I think this is a job for a macro, but I baulked at
getting the search routine to find *and select* all occurrences of "^d
hyperlink "mailto" as you can from the find dialog. Obviously there's a
trick - or rather a command line - I'm missing here

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
Good point. I hadn't thought of that. I just cut and pasted a post I
had made somewhere else earlier in the day.

For completeness, precede my instructions with ..

Ctrl+A
Format Autoformat OK

And follow them with ..

Ctrl+F6 to switch back to the original document
Ctrl+Z to undo the autoformatting


"Graham Mayor" wrote in message
...
If the email addresses are not hyperlinks, you would have to run
autoformat first to make them so.

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
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


"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?



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

You are correct, of course

Unfortunately the Select All option is not available from VBA - I guess it's
related to the fact that VBA can't handle non-contiguous Selections.

--
Enjoy,
Tony


"Graham Mayor" wrote in message
...
You would also have to check the autoformat options to ensure that the
convert hyperlinks option is checked - it might not be
With so many steps, I think this is a job for a macro, but I baulked at
getting the search routine to find *and select* all occurrences of "^d
hyperlink "mailto" as you can from the find dialog. Obviously there's a
trick - or rather a command line - I'm missing here

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
Good point. I hadn't thought of that. I just cut and pasted a post I
had made somewhere else earlier in the day.

For completeness, precede my instructions with ..

Ctrl+A
Format Autoformat OK

And follow them with ..

Ctrl+F6 to switch back to the original document
Ctrl+Z to undo the autoformatting


"Graham Mayor" wrote in message
...
If the email addresses are not hyperlinks, you would have to run
autoformat first to make them so.

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
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


"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?





  #8   Report Post  
Posted to microsoft.public.word.docmanagement
fsa
 
Posts: n/a
Default Email adresses

thanks for your help everbody..it really works and saved my time..

"fsa":

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?

  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill
 
Posts: n/a
Default Email adresses

If the addresses are hyperlinks, you could also search for the Hyperlink
character style (with field codes NOT displayed).

--
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.

"Graham Mayor" wrote in message
...
If the email addresses are not hyperlinks, you would have to run

autoformat
first to make them so.

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
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


"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?




  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Email adresses

I was afraid that was going to be the problem

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
You are correct, of course

Unfortunately the Select All option is not available from VBA - I
guess it's related to the fact that VBA can't handle non-contiguous
Selections.


"Graham Mayor" wrote in message
...
You would also have to check the autoformat options to ensure that
the convert hyperlinks option is checked - it might not be
With so many steps, I think this is a job for a macro, but I baulked
at getting the search routine to find *and select* all occurrences
of "^d hyperlink "mailto" as you can from the find dialog. Obviously
there's a trick - or rather a command line - I'm missing here

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
Good point. I hadn't thought of that. I just cut and pasted a post I
had made somewhere else earlier in the day.

For completeness, precede my instructions with ..

Ctrl+A
Format Autoformat OK

And follow them with ..

Ctrl+F6 to switch back to the original document
Ctrl+Z to undo the autoformatting


"Graham Mayor" wrote in message
...
If the email addresses are not hyperlinks, you would have to run
autoformat first to make them so.

--

Graham Mayor - Word MVP

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


Tony Jollans wrote:
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


"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?



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
How do I mail merge to EMAIL from MS Word AND add a pdf attachment Lily@Insight Mailmerge 24 January 15th 07 09:33 PM
Email Mail Merge problem sally r via OfficeKB.com Mailmerge 3 September 13th 05 06:37 AM
email merge to paired recipients [email protected] Mailmerge 1 August 30th 05 08:17 PM
wordd 2003- browser and email issues Gradey Skool New Users 4 January 16th 05 08:59 PM
How to attach a PDF file to a Mail Merge Email from Word? RPMissions Mailmerge 1 January 16th 05 07:06 AM


All times are GMT +1. The time now is 10:15 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"