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
| Sub number_me()
Dim osld As Slide
Const fontSZ As Long = 12
Dim SW As Long
Dim SH As Long
Dim x As Long
'x = 1
SW = ActivePresentation.PageSetup.SlideWidth
SH = ActivePresentation.PageSetup.SlideHeight
Call Killer ' remove old numbers
For Each osld In ActivePresentation.Slides
With osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 21, SH - 41, 30, 20)
.TextFrame2.TextRange = CStr(osld.SlideIndex + x + 1)
.TextFrame2.TextRange.Font.Size = fontSZ
.ZOrder (msoSendToBack)
.Name = "Mynumber"
End With
With osld.Shapes.AddTextbox(msoTextOrientationHorizontal, SW - 54, SH - 41, 30, 20)
.TextFrame2.TextRange = CStr(osld.SlideIndex + x + 2)
.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignRight
.TextFrame2.TextRange.Font.Size = fontSZ
.ZOrder (msoSendToBack)
.Name = "Mynumber"
End With
x = x + 1
Next osld
End Sub
Sub Killer()
Dim osld As Slide
Dim l As Long
For Each osld In ActivePresentation.Slides
For l = osld.Shapes.Count To 1 Step -1
If osld.Shapes(l).Name = "Mynumber" Then osld.Shapes(l).Delete
Next l
Next osld
End Sub |
Partager