Created
July 17, 2018 12:41
-
-
Save themacmarketer/e2f255d3f4e268d8ed8c6e2dc0347b59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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