Sub DeleteHtmlTags($pageSource As String) As String


DeleteHtmlTags deletes all HTML tags from $pageSource and returns the text of an HTML page.


In the first step, all HTML tags are replaced with blanks. In the second step, all duplicate blanks are replaced with a single blank.


In addition, all encoded characters are decoded, for example non-breaking spaces and encoded Unicode characters.


Parameters


  • $pageSource ... String expression. Source code of a web page.


Example:

Dim $s

$s = "This is <b>bold</b> and<br>a new line"
$s = DeleteHtmlTags($s)
' returns $s = "This is bold and a new line"