Dim strText, strReturned, strSearchString, strEndStringChars, strStartPos, strEndPos, strLength
Function subPullStrings(strText)
If instr(strText,"http:") = 0 Then
If len(strTextToReplace) = 0 then
subPullStrings = strText
Exit Function
End If
End If
strText = Replace(strText,"http://www.","*66775588*")
strText = Replace(strText,"www.","*66775588*")
strText = Replace(strText,"*66775588*","http://www.")
Do while instr(strText,"http:") > 0
strSearchString = "http:"
strEndStringChars = " "
strLength = 0
strStartPos = instr(1, strText, strSearchString)
strEndPos = instr(strStartPos + 1, strText, strEndStringChars)
strLength = strEndPos - strStartPos
strReturned = mid(strText,strStartPos + len(strSearchString),strLength - len(strSearchString) )
strStartPos = strEndPos + 1
strVisit = strReturned
strVisit = Replace(strVisit,"http:","")
strVisit = Replace(strVisit,"//","")
strVisit = Replace(strVisit,"www.","")
tempVisit = Split(strVisit,".")
strVisit = tempVisit(0)
strFinal = " <a href=""*444555*" + strReturned +
""" target=""_blank"" title=""Visit: " + strVisit + """>" &
strVisit & "</a> "
strFinal = Replace(strFinal,"'","")
strFinal = Replace(strFinal,",","")
strFinal = Replace(strFinal,"&","&")
strText = Replace(strText,"http:" & strReturned,strFinal)
Loop
strText = Replace(strText,"*444555*","http:")
subPullStrings = strText
End Function
|