Sample code for 30+ languages & platforms
VBScript

Convert HTML to Plain Text

Demonstrates how to convert HTML to plain text.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set h2t = CreateObject("Chilkat.HtmlToText")

html = h2t.ReadFileToString("c:/temp/test.html","utf-8")
If (h2t.LastMethodSuccess = 0) Then
    outFile.WriteLine(h2t.LastErrorText)
    WScript.Quit
End If

plainText = h2t.ToText(html)
If (h2t.LastMethodSuccess = 0) Then
    outFile.WriteLine(h2t.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine(plainText)

outFile.Close