Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I mail merge to EMAIL from MS Word AND add a pdf attachment | Mailmerge | |||
Email Mail Merge problem | Mailmerge | |||
email merge to paired recipients | Mailmerge | |||
wordd 2003- browser and email issues | New Users | |||
How to attach a PDF file to a Mail Merge Email from Word? | Mailmerge |