Check Email Addresses

P

Peter

I have about five thousand email addresses in a Word (or
Excel) file. Some have been mis-typed, for example, fred
@ somewhere.com (with spaces either side of the @) or
fred.somewhere.com.
Is there a simple macro that will check the integrity of
the addresses to ensure there are no spaces, and each
contains an @ sign?

Thanks
 
P

Peter

Many thanks, Helmut. I will give this a try. In fact, I
did quite well in Excel by using the SEARCH and
SUBSTITUTE functions before converting the document to
Word. It must be possible to have a macro as I suggested,
because Word will underline automatically a correctly
formatted email address. It must know what to look for.
Thanks again from Warminster in Wiltshire, UK.
Peter
 
H

Helmut Weber

Hi Peter,
you may use something like this as well,
but it isn't bulletproof either.

Dim p As Paragraph
For Each p In ActiveDocument.Paragraphs
If p.Range.Hyperlinks.Count = 0 Then
p.Range.Select : Stop ' or whatever
End If
Next

Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word 97, W98
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top