1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Sub TestHtml2()
Dim DocEncours As Document
Dim I As Integer, J As Integer, IndexMatrice As Integer, SerieBullet As Integer
Dim MonTexte As String
Dim MatriceBullet() As Variant
Set DocEncours = ActiveDocument
IndexMatrice = 0
With DocEncours
If .Lists.Count = 0 Then Exit Sub
For I = 1 To .Lists.Count
With .Lists(I)
For J = 1 To .ListParagraphs.Count
.ListParagraphs(J).Range.Select
ReDim Preserve MatriceBullet(3, IndexMatrice)
MatriceBullet(0, IndexMatrice) = I
MatriceBullet(1, IndexMatrice) = .ListParagraphs(J).Range.Text
Selection.HomeKey unit:=wdStory, Extend:=wdExtend
MatriceBullet(2, IndexMatrice) = Selection.Paragraphs.Count
IndexMatrice = IndexMatrice + 1
Next J
End With
Next I
End With
SerieBullet = 1
For IndexMatrice = LBound(MatriceBullet, 2) To UBound(MatriceBullet, 2) - 1
MatriceBullet(3, IndexMatrice) = SerieBullet
If MatriceBullet(2, IndexMatrice + 1) > MatriceBullet(2, IndexMatrice) + 1 Then
SerieBullet = SerieBullet + 1
End If
Next IndexMatrice
For IndexMatrice = LBound(MatriceBullet, 2) To UBound(MatriceBullet, 2) - 1
Debug.Print "Série : " & MatriceBullet(3, IndexMatrice) & ", " & MatriceBullet(2, IndexMatrice) & ", " & MatriceBullet(1, IndexMatrice)
Next IndexMatrice
Set DocEncours = Nothing
End Sub |
Partager