Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save runxel/31a3f98da96bacf3aa2b4b8cebffb519 to your computer and use it in GitHub Desktop.

Select an option

Save runxel/31a3f98da96bacf3aa2b4b8cebffb519 to your computer and use it in GitHub Desktop.

Revisions

  1. runxel revised this gist Jun 24, 2018. 1 changed file with 44 additions and 33 deletions.
    77 changes: 44 additions & 33 deletions Insert a progress bar to Powerpoint presentation.md
    Original file line number Diff line number Diff line change
    @@ -1,49 +1,60 @@
    ## Intro
    To view the progress of a Powerpoint presentation, a progress bar can be displayed at the bottom of the slide show.
    To view the progress of a Powerpoint presentation, a progress bar can be displayed at the **top** of the slide show.

    ## How to proceed
    Once the slideshow is complete, go to **Tools > Macro > Visual Basic Editor**.
    Once the slideshow is complete, go to **View > Macro** and create a new macro.

    In the new window, select **Insert > Module** and copy this text in the blank page:
    In the VBS editor copy this text in the blank page:
    ```vbs
    '' Add progress bar only to all non-hidden pages
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    sHeight = .PageSetup.SlideHeight - 12
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    On Error Resume Next
    With ActivePresentation
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("leftBar").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    '' Progressbar in red
    Set sliderPro = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, 0, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 6)
    With sliderPro
    .Fill.ForeColor.RGB = RGB(124, 0, 0)
    .Line.Visible = msoFalse
    .Name = "progressBar"
    End With
    '' Bar whats left (total) in light grey
    Set sliderLeft = .Slides(i).Shapes.AddShape(msoShapeRectangle, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 0, (.PageSetup.SlideWidth - ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j))), 6)
    With sliderLeft
    .Fill.ForeColor.RGB = RGB(236, 240, 241)
    .Line.Visible = msoFalse
    .Name = "leftBar"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    End Sub
    ```
    Then go to **File > Close > Return to Microsoft PowerPoint**
    In the displayed page of Microsoft Powerpoint, go to:
    **Tools > Macro > Macros**, then select *AddProcessBar* and press *Execute*
    You can now select *AddProcessBar* and press *Execute*

    ### How remove the progress bar?
    To remove the progress bar make we can add the following function:

    ```
    ```vbs
    '' Macro to remove the progress bar from all the slides
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    Next i:
    End With
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("leftBar").Delete
    Next i:
    End With
    End Sub
    ```
  2. runxel revised this gist Jun 24, 2018. 2 changed files with 38 additions and 28 deletions.
    2 changes: 1 addition & 1 deletion Insert a progress bar to Powerpoint presentation.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ To view the progress of a Powerpoint presentation, a progress bar can be display
    Once the slideshow is complete, go to **Tools > Macro > Visual Basic Editor**.

    In the new window, select **Insert > Module** and copy this text in the blank page:
    ```
    ```vbs
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    64 changes: 37 additions & 27 deletions PPT-Progress-Bar.vbs
    Original file line number Diff line number Diff line change
    @@ -1,34 +1,44 @@
    '' Add progress bar only to all non-hidden pages
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    sHeight = .PageSetup.SlideHeight - 12
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    On Error Resume Next
    With ActivePresentation
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("leftBar").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    '' Progressbar in red
    Set sliderPro = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, 0, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 6)
    With sliderPro
    .Fill.ForeColor.RGB = RGB(124, 0, 0)
    .Line.Visible = msoFalse
    .Name = "progressBar"
    End With
    '' Bar whats left (total) in light grey
    Set sliderLeft = .Slides(i).Shapes.AddShape(msoShapeRectangle, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 0, (.PageSetup.SlideWidth - ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j))), 6)
    With sliderLeft
    .Fill.ForeColor.RGB = RGB(236, 240, 241)
    .Line.Visible = msoFalse
    .Name = "leftBar"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    End Sub

    '' Macro to remove the progress bar from all the slides
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    Next i:
    End With
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("leftBar").Delete
    Next i:
    End With
    End Sub
  3. runxel revised this gist Jun 24, 2018. 2 changed files with 0 additions and 45 deletions.
    45 changes: 0 additions & 45 deletions PPT-Progress-Bar-with-Page-Numbers.vbs
    Original file line number Diff line number Diff line change
    @@ -1,45 +0,0 @@
    '' Add progress bar and page numbers to all non-hidden pages
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    sHeight = .PageSetup.SlideHeight - 12
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("pageNumber").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Set pageNumber = .Slides(i).Shapes.AddTextbox(msoTextOrientationHorizontal, ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j)) - 40, .PageSetup.SlideHeight - 15, 100, 10)
    With pageNumber
    .TextFrame.TextRange.Text = Str(i - n) & "/" & Str(ActivePresentation.Slides.Count - j)
    With .TextFrame.TextRange.Font
    .Bold = msoFalse
    .Size = 10
    End With
    .Name = "pageNumber"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    End Sub

    '' Macro to remove the progress bar from all the slides
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("pageNumber").Delete
    Next i:
    End With
    End Sub
  4. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Insert a progress bar to Powerpoint presentation .md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@
    To view the progress of a Powerpoint presentation, a progress bar can be displayed at the bottom of the slide show.

    ## How to proceed
    Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.
    Once the slideshow is complete, go to **Tools > Macro > Visual Basic Editor**.

    In the new window, select Insert > Module and copy this text in the blank page:
    In the new window, select **Insert > Module** and copy this text in the blank page:
    ```
    Sub AddProgressBar()
    On Error Resume Next
    @@ -30,9 +30,9 @@ Sub AddProgressBar()
    End With
    End Sub
    ```
    Then go to File > Close > Return to Microsoft PowerPoint
    Then go to **File > Close > Return to Microsoft PowerPoint**
    In the displayed page of Microsoft Powerpoint, go to:
    Tools > Macro > Macros, then select AddProcessBar and press Execute
    **Tools > Macro > Macros**, then select *AddProcessBar* and press *Execute*

    ### How remove the progress bar?
    To remove the progress bar make we can add the following function:
  5. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 2 changed files with 16 additions and 6 deletions.
    20 changes: 15 additions & 5 deletions Insert a progress bar to Powerpoint presentation .md
    Original file line number Diff line number Diff line change
    @@ -9,13 +9,23 @@ In the new window, select Insert > Module and copy this text in the blank page:
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    sHeight = .PageSetup.SlideHeight - 12
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, .PageSetup.SlideHeight - 12, (i) * .PageSetup.SlideWidth / (.Slides.Count), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    End Sub
    2 changes: 1 addition & 1 deletion PPT-Progress-Bar-with-Page-Numbers.vbs
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Sub AddProgressBar()
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("pageNumber").Delete
    .Slides(i).Shapes("pageNumber").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
  6. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 2 changed files with 45 additions and 1 deletion.
    45 changes: 45 additions & 0 deletions PPT-Progress-Bar-with-Page-Numbers.vbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    '' Add progress bar and page numbers to all non-hidden pages
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    sHeight = .PageSetup.SlideHeight - 12
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("pageNumber").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Set pageNumber = .Slides(i).Shapes.AddTextbox(msoTextOrientationHorizontal, ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j)) - 40, .PageSetup.SlideHeight - 15, 100, 10)
    With pageNumber
    .TextFrame.TextRange.Text = Str(i - n) & "/" & Str(ActivePresentation.Slides.Count - j)
    With .TextFrame.TextRange.Font
    .Bold = msoFalse
    .Size = 10
    End With
    .Name = "pageNumber"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    End Sub

    '' Macro to remove the progress bar from all the slides
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    .Slides(i).Shapes("pageNumber").Delete
    Next i:
    End With
    End Sub
    1 change: 0 additions & 1 deletion text.vbs
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    '' Add progress bar and page numbers to all non-hidden pagesSub AddProgressBar() On Error Resume Next With ActivePresentation sHeight = .PageSetup.SlideHeight - 12 n = 0 j = 0 For i = 1 To .Slides.Count If .Slides(i).SlideShowTransition.Hidden Then j = j + 1 Next i: For i = 2 To .Slides.Count .Slides(i).Shapes("progressBar").Delete .Slides(i).Shapes("pageNumber").Delete If .Slides(i).SlideShowTransition.Hidden = msoFalse Then Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12) With slider .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB .Name = "progressBar" End With Set pageNumber = .Slides(i).Shapes.AddTextbox(msoTextOrientationHorizontal, ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j)) - 40, .PageSetup.SlideHeight - 15, 100, 10) With pageNumber .TextFrame.TextRange.Text = Str(i - n) & "/" & Str(ActivePresentation.Slides.Count - j) With .TextFrame.TextRange.Font .Bold = msoFalse .Size = 10 End With .Name = "pageNumber" End With Else n = n + 1 End If Next i: End WithEnd Sub'' Macro to remove the progress bar from all the slidesSub RemoveProgressBar() On Error Resume Next With ActivePresentation For i = 1 To .Slides.Count .Slides(i).Shapes("progressBar").Delete .Slides(i).Shapes("pageNumber").Delete Next i: End WithEnd Sub
  7. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion text.vbs
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    Sub AddProgressBar() On Error Resume Next With ActivePresentation sHeight = .PageSetup.SlideHeight - 12 n = 0 j = 0 For i = 1 To .Slides.Count If .Slides(i).SlideShowTransition.Hidden Then j = j + 1 Next i: For i = 2 To .Slides.Count .Slides(i).Shapes("progressBar").Delete '' .Slides(i).Shapes("pageNumber").Delete If .Slides(i).SlideShowTransition.Hidden = msoFalse Then Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12) With slider .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB .Name = "progressBar" End With '' Set pageNumber = .Slides(i).Shapes.AddTextbox(msoTextOrientationHorizontal, ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j)) - 40, .PageSetup.SlideHeight - 15, 100, 10) '' With pageNumber '' .TextFrame.TextRange.Text = Str(i - n) & "/" & Str(ActivePresentation.Slides.Count - j) '' With .TextFrame.TextRange.Font '' .Bold = msoFalse '' .Size = 10 '' End With '' .Name = "pageNumber" '' End With Else n = n + 1 End If Next i: End WithEnd Sub
    '' Add progress bar and page numbers to all non-hidden pagesSub AddProgressBar() On Error Resume Next With ActivePresentation sHeight = .PageSetup.SlideHeight - 12 n = 0 j = 0 For i = 1 To .Slides.Count If .Slides(i).SlideShowTransition.Hidden Then j = j + 1 Next i: For i = 2 To .Slides.Count .Slides(i).Shapes("progressBar").Delete .Slides(i).Shapes("pageNumber").Delete If .Slides(i).SlideShowTransition.Hidden = msoFalse Then Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12) With slider .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB .Name = "progressBar" End With Set pageNumber = .Slides(i).Shapes.AddTextbox(msoTextOrientationHorizontal, ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j)) - 40, .PageSetup.SlideHeight - 15, 100, 10) With pageNumber .TextFrame.TextRange.Text = Str(i - n) & "/" & Str(ActivePresentation.Slides.Count - j) With .TextFrame.TextRange.Font .Bold = msoFalse .Size = 10 End With .Name = "pageNumber" End With Else n = n + 1 End If Next i: End WithEnd Sub'' Macro to remove the progress bar from all the slidesSub RemoveProgressBar() On Error Resume Next With ActivePresentation For i = 1 To .Slides.Count .Slides(i).Shapes("progressBar").Delete .Slides(i).Shapes("pageNumber").Delete Next i: End WithEnd Sub
  8. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions text.vbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Sub AddProgressBar() On Error Resume Next With ActivePresentation sHeight = .PageSetup.SlideHeight - 12 n = 0 j = 0 For i = 1 To .Slides.Count If .Slides(i).SlideShowTransition.Hidden Then j = j + 1 Next i: For i = 2 To .Slides.Count .Slides(i).Shapes("progressBar").Delete '' .Slides(i).Shapes("pageNumber").Delete If .Slides(i).SlideShowTransition.Hidden = msoFalse Then Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12) With slider .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB .Name = "progressBar" End With '' Set pageNumber = .Slides(i).Shapes.AddTextbox(msoTextOrientationHorizontal, ((i - n) * .PageSetup.SlideWidth / (.Slides.Count - j)) - 40, .PageSetup.SlideHeight - 15, 100, 10) '' With pageNumber '' .TextFrame.TextRange.Text = Str(i - n) & "/" & Str(ActivePresentation.Slides.Count - j) '' With .TextFrame.TextRange.Font '' .Bold = msoFalse '' .Size = 10 '' End With '' .Name = "pageNumber" '' End With Else n = n + 1 End If Next i: End WithEnd Sub
  9. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 2 changed files with 49 additions and 19 deletions.
    33 changes: 15 additions & 18 deletions Insert a progress bar to Powerpoint presentation .md
    Original file line number Diff line number Diff line change
    @@ -6,18 +6,18 @@ Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

    In the new window, select Insert > Module and copy this text in the blank page:
    ```
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
    0, .PageSetup.SlideHeight - 12, _
    X * .PageSetup.SlideWidth / .Slides.Count, 12)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, .PageSetup.SlideHeight - 12, (i) * .PageSetup.SlideWidth / (.Slides.Count), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Next i:
    End With
    End Sub
    ```
    Then go to File > Close > Return to Microsoft PowerPoint
    @@ -31,12 +31,9 @@ To remove the progress bar make we can add the following function:
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    Next i:
    End With
    End Sub
    ```
    35 changes: 34 additions & 1 deletion PPT-Progress-Bar.vbs
    Original file line number Diff line number Diff line change
    @@ -1 +1,34 @@
    '' Add progress bar only to all non-hidden pagesSub AddProgressBar() On Error Resume Next With ActivePresentation sHeight = .PageSetup.SlideHeight - 12 n = 0 j = 0 For i = 1 To .Slides.Count If .Slides(i).SlideShowTransition.Hidden Then j = j + 1 Next i: For i = 2 To .Slides.Count .Slides(i).Shapes("progressBar").Delete If .Slides(i).SlideShowTransition.Hidden = msoFalse Then Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12) With slider .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB .Name = "progressBar" End With Else n = n + 1 End If Next i: End WithEnd Sub'' Macro to remove the progress bar from all the slidesSub RemoveProgressBar() On Error Resume Next With ActivePresentation For i = 1 To .Slides.Count .Slides(i).Shapes("progressBar").Delete Next i: End WithEnd Sub
    '' Add progress bar only to all non-hidden pages
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    sHeight = .PageSetup.SlideHeight - 12
    n = 0
    j = 0
    For i = 1 To .Slides.Count
    If .Slides(i).SlideShowTransition.Hidden Then j = j + 1
    Next i:
    For i = 2 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    If .Slides(i).SlideShowTransition.Hidden = msoFalse Then
    Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12)
    With slider
    .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB
    .Name = "progressBar"
    End With
    Else
    n = n + 1
    End If
    Next i:
    End With
    End Sub

    '' Macro to remove the progress bar from all the slides
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For i = 1 To .Slides.Count
    .Slides(i).Shapes("progressBar").Delete
    Next i:
    End With
    End Sub
  10. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 1 addition and 26 deletions.
    27 changes: 1 addition & 26 deletions PPT-Progress-Bar.vbs
    Original file line number Diff line number Diff line change
    @@ -1,26 +1 @@
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
    0, .PageSetup.SlideHeight - 12, _
    X * .PageSetup.SlideWidth / .Slides.Count, 12)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    End Sub


    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    End Sub
    '' Add progress bar only to all non-hidden pagesSub AddProgressBar() On Error Resume Next With ActivePresentation sHeight = .PageSetup.SlideHeight - 12 n = 0 j = 0 For i = 1 To .Slides.Count If .Slides(i).SlideShowTransition.Hidden Then j = j + 1 Next i: For i = 2 To .Slides.Count .Slides(i).Shapes("progressBar").Delete If .Slides(i).SlideShowTransition.Hidden = msoFalse Then Set slider = .Slides(i).Shapes.AddShape(msoShapeRectangle, 0, sHeight, (i - n) * .PageSetup.SlideWidth / (.Slides.Count - j), 12) With slider .Fill.ForeColor.RGB = ActivePresentation.SlideMaster.ColorScheme.Colors(ppFill).RGB .Name = "progressBar" End With Else n = n + 1 End If Next i: End WithEnd Sub'' Macro to remove the progress bar from all the slidesSub RemoveProgressBar() On Error Resume Next With ActivePresentation For i = 1 To .Slides.Count .Slides(i).Shapes("progressBar").Delete Next i: End WithEnd Sub
  11. @PiiXiieeS PiiXiieeS renamed this gist Oct 27, 2013. 1 changed file with 0 additions and 0 deletions.
  12. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ To view the progress of a Powerpoint presentation, a progress bar can be display
    Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

    In the new window, select Insert > Module and copy this text in the blank page:
    ```vbscript
    ```
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
  13. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ To view the progress of a Powerpoint presentation, a progress bar can be display
    Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

    In the new window, select Insert > Module and copy this text in the blank page:
    ```javascript
    ```vbscript
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
  14. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ To view the progress of a Powerpoint presentation, a progress bar can be display
    Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

    In the new window, select Insert > Module and copy this text in the blank page:
    ```
    ```javascript
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
  15. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 1 changed file with 21 additions and 3 deletions.
    24 changes: 21 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ To view the progress of a Powerpoint presentation, a progress bar can be display
    Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

    In the new window, select Insert > Module and copy this text in the blank page:

    ```
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    @@ -18,7 +18,25 @@ In the new window, select Insert > Module and copy this text in the blank page:
    s.Name = "PB"
    Next X:
    End With
    End Sub
    End Sub
    ```
    Then go to File > Close > Return to Microsoft PowerPoint
    In the displayed page of Microsoft Powerpoint, go to:
    Tools > Macro > Macros, then select AddProcessBar and press Execute
    Tools > Macro > Macros, then select AddProcessBar and press Execute

    ### How remove the progress bar?
    To remove the progress bar make we can add the following function:

    ```
    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    End Sub
    ```
  16. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. No changes.
  17. @PiiXiieeS PiiXiieeS revised this gist Oct 27, 2013. 2 changed files with 50 additions and 1 deletion.
    27 changes: 26 additions & 1 deletion PPT-Progress-Bar.vbs
    Original file line number Diff line number Diff line change
    @@ -1 +1,26 @@
    Sub AddProgressBar() On Error Resume Next With ActivePresentation For X = 1 To .Slides.Count .Slides(X).Shapes("PB").Delete Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _ 0, .PageSetup.SlideHeight - 12, _ X * .PageSetup.SlideWidth / .Slides.Count, 12) s.Fill.ForeColor.RGB = RGB(127, 0, 0) s.Name = "PB" Next X: End WithEnd SubSub RemoveProgressBar() On Error Resume Next With ActivePresentation For X = 1 To .Slides.Count .Slides(X).Shapes("PB").Delete Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0) s.Fill.ForeColor.RGB = RGB(127, 0, 0) s.Name = "PB" Next X: End WithEnd Sub
    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
    0, .PageSetup.SlideHeight - 12, _
    X * .PageSetup.SlideWidth / .Slides.Count, 12)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    End Sub


    Sub RemoveProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    End Sub
    24 changes: 24 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    ## Intro
    To view the progress of a Powerpoint presentation, a progress bar can be displayed at the bottom of the slide show.

    ## How to proceed
    Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

    In the new window, select Insert > Module and copy this text in the blank page:

    Sub AddProgressBar()
    On Error Resume Next
    With ActivePresentation
    For X = 1 To .Slides.Count
    .Slides(X).Shapes("PB").Delete
    Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
    0, .PageSetup.SlideHeight - 12, _
    X * .PageSetup.SlideWidth / .Slides.Count, 12)
    s.Fill.ForeColor.RGB = RGB(127, 0, 0)
    s.Name = "PB"
    Next X:
    End With
    End Sub
    Then go to File > Close > Return to Microsoft PowerPoint
    In the displayed page of Microsoft Powerpoint, go to:
    Tools > Macro > Macros, then select AddProcessBar and press Execute
  18. @PiiXiieeS PiiXiieeS created this gist Oct 27, 2013.
    1 change: 1 addition & 0 deletions PPT-Progress-Bar.vbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Sub AddProgressBar() On Error Resume Next With ActivePresentation For X = 1 To .Slides.Count .Slides(X).Shapes("PB").Delete Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _ 0, .PageSetup.SlideHeight - 12, _ X * .PageSetup.SlideWidth / .Slides.Count, 12) s.Fill.ForeColor.RGB = RGB(127, 0, 0) s.Name = "PB" Next X: End WithEnd SubSub RemoveProgressBar() On Error Resume Next With ActivePresentation For X = 1 To .Slides.Count .Slides(X).Shapes("PB").Delete Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0) s.Fill.ForeColor.RGB = RGB(127, 0, 0) s.Name = "PB" Next X: End WithEnd Sub