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
|
Sub SommaireTest()
Dim i As Integer
i = ActivePresentation.Slides.Count
' a faire
' en fonction du nombre de slide, creer X slide pour le sommaire
' Crée un tableau pour recuperer les titres (a faire: ajouter X slide + decomptage nbr slide)
Dim Title() As String
' remplir le tableau des titre
Dim c As String
c = ""
For y = 2 To i
Set Diapo = ActivePresentation.Slides(y)
Dim a As Integer
Dim b As Integer
a = InStr(Diapo.Shapes.Title.TextFrame.TextRange.Text, "-")
b = Len(Diapo.Shapes.Title.TextFrame.TextRange.Text)
If a = 0 Then
ReDim Preserve Title(0 To y)
Title(y) = Diapo.Shapes.Title.TextFrame.TextRange.Text
Else
If c = Left(Diapo.Shapes.Title.TextFrame.TextRange.Text, a) Then
Title(y) = Left(Diapo.Shapes.Title.TextFrame.TextRange.Text, a)
ReDim Preserve Title(0 To y + 1)
y = y + 1
Title(y) = Right(Diapo.Shapes.Title.TextFrame.TextRange.Text, b - a)
Else
Title(y) = Left(Diapo.Shapes.Title.TextFrame.TextRange.Text, a)
c = Left(Diapo.Shapes.Title.TextFrame.TextRange.Text, a)
End If
End If
Next |
Partager