Per un campo testo usa questa funzione:
codice:
Function HTMLDecode(encodedstring)
Dim tmp, i
tmp = encodedstring
tmp = Replace( tmp, """, chr(34) )
tmp = Replace( tmp, "<" , chr(60) )
tmp = Replace( tmp, ">" , chr(62) )
tmp = Replace( tmp, "&" , chr(38) )
tmp = Replace( tmp, "", chr(32) )
HTMLDecode = tmp
End Function
Se, poi, oltre a decodificare i tag HTML, li vuoi anche eliminare, puoi usare:
codice:
function RemoveTags(txt)
dim tmptxt
tmptxt = txt
if IsNull(tmptxt) then
exit function
end if
dim i, pos1, pos2
do
pos1 = Instr(tmptxt, "<")
if pos1=0 then
exit do
else
pos2 = Instr(pos1, tmptxt, ">")
if pos2=0 then
exit do
else
tmptxt = Left(tmptxt, pos1-1)&Mid(tmptxt, pos2+1)
end if
end if
loop
RemoveTags = tmptxt
end function