VBA script for PowerPoint progress bar

Open PowerPoint, press Ctrl + F11, copy and paste the VBA codes below, then press F5, run.

Sub AddProgressBar()
    On Error Resume Next
        With ActivePresentation
            For X = 2 To .Slides.Count - 1
            .Slides(X).Shapes("PB").Delete
            Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
                0, .PageSetup.SlideHeight - 3, _
                (X-1) * .PageSetup.SlideWidth / (.Slides.Count-2), 3)
            s.Fill.ForeColor.RGB = RGB(0, 176, 240)
            s.Line.Visible = msoFalse
            s.Name = "PB"
            Next X:
        End With
End Sub

After that you will see a progress bar in cyan color at the bottom of the slides.

2014-05-15 23:0037
comments powered by Disqus