Concatenating email addresses

Results 1 to 2 of 2

Thread: Concatenating email addresses

  1. #1
    Join Date
    Dec 1969

    Default Concatenating email addresses

    What it is is that I have a text field coming from a database to be <BR>displayed on screen. What I want to be able to do is to do a quick <BR>search on that text field and look for an email address or the @ <BR>character. If found, I want to delete the remainder of the message <BR>OR (more preferably) take out the email address eg.<BR><BR>"Hi my name is Bob, email me at to get in touch."<BR><BR>would look like...<BR><BR>"Hi my name is Bob, email me at Bob@" OR "Hi my name is Bob, <BR>email me at Bob@..."<BR><BR>or<BR><BR>"Hi my name is Bob, email me at Bob@... to get in touch"<BR><BR>Very much like the way Egroups deals with email addresses in the <BR>messages, something like that would be ideal.<BR><BR>TIA

  2. #2
    Join Date
    Dec 1969

    Default Create a function...

    &#060;%<BR>Function RemoveEmailAddress(strMessage)<BR> <BR> Do While InStr(strMessage, "@") &#062; 0<BR> <BR> &#039; Find the start character of the email address.<BR> Dim intStartPos<BR> intStart = InStrRev(strMessage, " ", InStr(strMessage, "@"))<BR> <BR> &#039; Find the last character of the email address.<BR> Dim intLastPos<BR> intLastPos = InStr(InStr(strMessage, "@"), strMessage, " ")<BR> <BR> &#039; Find the entire email address<BR> Dim strEmailAddress<BR> strEmailAddress = Mid(strMessage, intStartPos, intLastPos-intStartPos)<BR> strMessage = Replace(strMessage, strEmailAddress, "[Email Removed]")<BR> <BR> loop<BR> RemoveEmailAddress = strMessage<BR> <BR>End Function<BR>%&#062;<BR><BR>That&#039;s off the top of my head...<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts