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
| Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Sub Rebours()
' déclaration
Dim sld As Slide
Dim shpFond As Shape
Dim shpRebours As Shape
Dim t As Date
Dim i As Byte
' affectation
Set sld = ActivePresentation.Slides(2)
' on crée la forme de fond
Set shpFond = sld.Shapes.AddShape(msoShapeRectangle, 25, 25, 90, 20)
With shpFond
.Fill.ForeColor.RGB = RGB(200, 50, 50)
.Fill.Visible = msoTrue
End With
' on crée la forme qui fera la barre de progression, mais avec une longueur nulle
Set shpRebours = sld.Shapes.AddShape(msoShapeRectangle, 25, 25, 0, 20)
With shpRebours
.Fill.ForeColor.RGB = RGB(50, 50, 200)
.Fill.Visible = msoTrue
End With
' passage au deuxième slide
SlideShowWindows(1).View.GotoSlide 2
' compte à rebours
For i = 1 To 45
shpRebours.Width = i * 2
DoEvents
Sleep 1000
Next i
End Sub |
Partager