Réponse acceptée !
Vu que aparement il n'y a pas de fonction pour cela j'en fait une qui fait à peut près ce que je voulais.
function HTMLtoTexte(pTexte) pTexte = Replace(pTexte, "<TR>", vbcrlf) pTexte = Replace(pTexte, "</TR>", vbcrlf) pTexte = Replace(pTexte, "<BR>", vbcrlf) pTexte = Replace(pTexte, "<BR />", vbcrlf) pTexte = Replace(pTexte, "<tr>", vbcrlf) pTexte = Replace(pTexte, "</tr>", vbcrlf) pTexte = Replace(pTexte, "<br>", vbcrlf) pTexte = Replace(pTexte, "<br />", vbcrlf) vRes = "" vInBalise = false For vCpt = 1 to Len(pTexte) if Mid(pTexte, vCpt, 1) <> "<" and Mid(pTexte, vCpt, 1) <> ">" and not vInBalise then vRes = vRes & Mid(pTexte, vCpt, 1) end if if Mid(pTexte, vCpt, 1) = "<" and Not vInBalise then vInBalise = true else if Mid(pTexte, vCpt, 1) = ">" and vInBalise then vInBalise = false end if end if Next vRes = Mid(vRes, Instr(UCase(vRes), "BONJOUR")) vRes = Replace(vRes, vbcrlf & vbcrlf , vbcrlf) HTMLtoTexte = vRes End function
|