I have this code lying around... what it does is remove all HTML tags leaving the text.
VB Code:
Private Sub Command1_Click() Dim strWorking As String Dim strOutput As String Dim lngPosLessThan As Long strWorking = Text1.Text Do While Len(strWorking) > 0 If Left(strWorking, 1) = "<" Then strWorking = Mid(strWorking, InStr(1, strWorking, ">") + 1) Else lngPosLessThan = InStr(1, strWorking, "<") If lngPosLessThan > 0 Then 'Move non-Tag string to strOutput strOutput = strOutput & Left(strWorking, lngPosLessThan - 1) strWorking = Mid(strWorking, InStr(1, strWorking, "<")) Else 'no other tag in string. strOutput = strOutput & strWorking strWorking = "" End If End If Loop Text2.Text = strOutput End Sub
In case your willing to enhance it to fit your needs.




Reply With Quote