J
Jay
Hi everyone,
I have a text box bound to a memo field. My end users enter email
distribution lists into it and eventually click a button that sends an email
to these addresses.
Is there a "email address validation" routine?
The problem is that sometimes apostrophes, quotes, or worse, carriage
returns, are getting into this field, probably from my users copying/pasting
the addresses into this field from God knows what. These weird characters are
causing pretty bizzare behavior in Exchange, and I have to get this settled
once and for all. The business situation is such that I can't limit them to a
drop down list. There are hundreds of possible addressess, and a typical
email goes to 5 to 20 of them in just about every combination imaginable. Of
course this is a pain to get straight, which is why my end users are making
shortcut lists of common entries in Word, or copying from old email, or
whatever. Hence the weird characters.
So far, my amateur VBA skills allowed me to figure out I can use the InStr()
function to look for Chr(13) after the field is updated, and then give a
MsgBox to tell the user to fix it. I am hoping there is a way to avoid doing
this for every ascii character that is not a letter, number or puncutation
mark, but I will do it if necessary. However, this method does not guarantee
my end users will actually fix anything - or more to the point, will
understand exactly what needs fixing. I need a bullet proof solution. About 1
in 500 is blowing up, and that's enough to cause whole project to boil over.
What do you think?
I have a text box bound to a memo field. My end users enter email
distribution lists into it and eventually click a button that sends an email
to these addresses.
Is there a "email address validation" routine?
The problem is that sometimes apostrophes, quotes, or worse, carriage
returns, are getting into this field, probably from my users copying/pasting
the addresses into this field from God knows what. These weird characters are
causing pretty bizzare behavior in Exchange, and I have to get this settled
once and for all. The business situation is such that I can't limit them to a
drop down list. There are hundreds of possible addressess, and a typical
email goes to 5 to 20 of them in just about every combination imaginable. Of
course this is a pain to get straight, which is why my end users are making
shortcut lists of common entries in Word, or copying from old email, or
whatever. Hence the weird characters.
So far, my amateur VBA skills allowed me to figure out I can use the InStr()
function to look for Chr(13) after the field is updated, and then give a
MsgBox to tell the user to fix it. I am hoping there is a way to avoid doing
this for every ascii character that is not a letter, number or puncutation
mark, but I will do it if necessary. However, this method does not guarantee
my end users will actually fix anything - or more to the point, will
understand exactly what needs fixing. I need a bullet proof solution. About 1
in 500 is blowing up, and that's enough to cause whole project to boil over.
What do you think?