|
-
Dec 9th, 2002, 11:00 PM
#1
Thread Starter
New Member
Convert HTML Text to Regular Text..Please help
Okay, I have the logs of AIM Conversations [ I'm making an AIM Logger], and I would like for the logs to be plain text - But the AIM Window has them as HTML, How do I take all the HTML Out And just have it plain, so its nice and plain in notepad? MUCH thanks
Learning & Understanding the REAL meaning of zero's and one's.

-
Dec 9th, 2002, 11:07 PM
#2
Here is a code made by me:
VB Code:
Dim A As Long, B As Long, Buffer As String, Temp As String
On Error Resume Next
Buffer = Teksti.Text
A = InStr(Buffer, "<")
Do While A 'remove the tags
DoEvents
B = A
A = InStr(Buffer, ">")
If A = 0 Then Exit Do
Temp = LCase(Mid(Buffer, B, A - B + 1))
If Temp Like "<br>" Or Temp Like "</h1>" Or Temp Like "</h2>" Or Temp Like "</h3>" Or Temp Like "</h4>" Or Temp Like "</h5>" Or Temp Like "</h6>" Or Temp Like "<hr>" Or Temp Like "<p>" Then
Buffer = Left(Buffer, B - 1) & vbCrLf & Right(Buffer, Len(Buffer) - A)
Else
Buffer = Left(Buffer, B - 1) & Right(Buffer, Len(Buffer) - A)
End If
A = InStr(Buffer, "<")
Loop
A = InStr(Buffer, vbCrLf & vbCrLf)
Do While A 'remove too many enters
DoEvents
Buffer = Left(Buffer, A) & Right(Buffer, Len(Buffer) - A - Len(vbCrLf))
A = InStr(Buffer, vbCrLf & vbCrLf)
Loop
Teksti.Text = Buffer
As for where Teksti is a TextBox / RichTextBox You can do more validating by yourself (I'm not sure what all AIM has). Anyways, I hope this helps!
-
Dec 9th, 2002, 11:08 PM
#3
Use this link!
Strip HTML tags
Cheers!
Abhijit
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Dec 10th, 2002, 03:04 PM
#4
Thread Starter
New Member
Learning & Understanding the REAL meaning of zero's and one's.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|