Check If String Is Valid Email Address
This code uses
If you don't have this control, you can download it from www.microsoft.com/msdownload/vbscript/scripting.asp
Add Microsoft VBScript Regular Expressions reference to your project
(choose Project->References, check the Microsoft VBScript Regular Expressions
CheckBox and Press OK).
Now after you added this references, the code can
RegExp is type of variable that allow you to check String
for certains formats, like if string is Email address, phone number, and your
own custom formats.
Dim myReg As RegExp
email As String
Set myReg = New
myReg.IgnoreCase = True
'replace "email@example.com" with the email
address you want
email = "firstname.lastname@example.org"
MsgBox "the result of validation checking: " & myReg.Test(email)