Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save themacmarketer/e2f255d3f4e268d8ed8c6e2dc0347b59 to your computer and use it in GitHub Desktop.
Save themacmarketer/e2f255d3f4e268d8ed8c6e2dc0347b59 to your computer and use it in GitHub Desktop.
Sub addCustomSlideNumber()
On Error Resume Next
Dim PPSlide As Slide
For Each PPSlide In ActivePresentation.Slides
PPSlide.Shapes("customNumberBox").Delete
Next
Dim x As Integer
Dim slideToNumber As Slide
Dim oShape As Shape
For Each slideToNumber In ActivePresentation.Slides
If slideToNumber.SlideShowTransition.Hidden = msoFalse Then
x = x + 1
slideToNumber.HeadersFooters.SlideNumber.Visible = msoFalse
Set oShape = slideToNumber.Shapes.AddTextBox(msoTextOrientationHorizontal, 890, 500, 50, 14)
With oShape
.TextFrame.TextRange.Text = CStr(x)
.TextEffect.FontName = "Palatino"
.TextEffect.FontSize = 10
.TextEffect.Alignment = msoTextEffectAlignmentRight
.Name = "customNumberBox"
End With
Else
slideToNumber.HeadersFooters.SlideNumber.Visible = msoFalse
End If
Next
End Sub
Sub deleteTextBox()
On Error Resume Next
Dim PPSlide As Slide
For Each PPSlide In ActivePresentation.Slides
PPSlide.Shapes("customNumberBox").Delete
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment