ReS = Join(TbL, vbCrLf)
htmlCod = res2
OriginalHtmlCode = PrE.outerhtml
'Debug.Print ReS
ReS = MesCommentaires(ReS)
TextBox2 = ReS
IndentCode = ReS
Unload barprogress
End Function
Private Function MesCommentaires(ReS As Variant) As String
Dim TabLig() As String
Dim i As Long
Dim k As Long
Dim p As Long
TabLig = Split(ReS, vbCrLf)
p = xlNone
For i = LBound(TabLig) + 1 To UBound(TabLig)
k = i - 1
Do While k >= 1 And (Left(Trim(TabLig(k)), 1) = "'" Or Len(Trim(TabLig(k))) = 0)
If Not Len(Trim(TabLig(k))) = 0 Then
If p = xlNone Then
For p = 1 To Len(TabLig(i))
If Not Mid(TabLig(i), p, 1) = " " Then Exit For
Next p
p = p - 1
End If
TabLig(k) = Left(TabLig(i), p) & Trim(TabLig(k))
End If
k = k - 1
Loop
p = xlNone
Next i
MesCommentaires = Join(TabLig, vbCrLf)
End Function