I'm trying to design code that will search for any 10 digit number in an e-mail after pressing the Send button in Microsoft Outlook 2003. I know that simply using the InStr() function would easily perform this if I had a specific string; however, I only want to look for 10 digit numbers. Here is what I'm trying to do:
If InStr(1, Item.Body, TenNumber, vbTextCompare) > 0 Then
<some condition>
However, TenNumber doesn't have a specific value.
I was thinking of using the Len() function to check for a string length of 10, and then using the IsNumeric() function to make sure it's a number (even though it's really a string). The only problem with this is that I don't know how to search through an e-mail to look for a string of length 10.
Any ideas???
If InStr(1, Item.Body, TenNumber, vbTextCompare) > 0 Then
<some condition>
However, TenNumber doesn't have a specific value.
I was thinking of using the Len() function to check for a string length of 10, and then using the IsNumeric() function to make sure it's a number (even though it's really a string). The only problem with this is that I don't know how to search through an e-mail to look for a string of length 10.
Any ideas???
Comment