Next
TbL = Split(ReS, vbCrLf)
Dim tbl4, A&, SpoC
For i = 0 To UBound(TbL)
If TbL(i) Like "*" & ChrW$(937) & "*" Then
'MsgBox TbL(i)
SpoC = ""
tbl4 = Split(TbL(i), ChrW$(937))
Select Case True
Case Left(Trim(tbl4(0)), 3) = "If ": SpoC = Application.Rept(" ", InStr((TbL(i)), "If ") + 4)'4 ou plus ou moins'
Case tbl4(0) Like "*Declare*function*": SpoC = Application.Rept(" ", 30)'30 ou plus ou moins '
Case tbl4(0) Like "*""*": SpoC = Application.Rept(" ", InStr((TbL(i)), """"))'pour les msgbox ou autres on indente au premier Guillemet
Case tbl4(0) Like "*(*)*": SpoC = Application.Rept(" ", InStr((TbL(i)), "("))'sinon la première parenthèse
Case tbl4(0) Like "*_*": SpoC = Application.Rept(" ", InStr(Trim(TbL(i)), "_") - 5)sinon si il n'i a aucun repère on prend le "_"- 5 caractère
Case Else: SpoC = ""'dans le pire des cas on indente pas '
End Select
tbl4 = Split(TbL(i), ChrW$(937))
For A = 1 To UBound(tbl4)
'MsgBox "|" & tbl4(A)
tbl4(A) = SpoC & Replace(Trim(tbl4(A)), Chr(160), ""): Next
TbL(i) = Join(tbl4, vbCrLf)
End If
Next
ReS = Join(TbL, vbCrLf)
htmlCod = res2
OriginalHtmlCode = PrE.outerhtml
'Debug.Print ReS
TextBox2 = ReS
IndentCode = ReS
Unload barprogress
End Function