Thread: [Solved] Page numbering
View Single Post
 
Old 09-18-2022, 11:44 AM
NickyB NickyB is offline Windows 10 Office 2016
Novice
 
Join Date: Sep 2022
Posts: 5
NickyB is on a distinguished road
Default

Hello John,

Wow! thank you very much! That was very fast!
This exactly what I want.

I've only change the numbering (start at 2 because the first page is pair).

I've tried to reduce the size of the text but it is not working when I change "osld.Shapes.AddTextbox" value...

Any idea ?
while awaiting developments, THANK YOU VERY MUCH!
Here the code I modify.

Code:
Sub number_Me()

Dim osld As Slide
Dim SW As Long
Dim SH As Long
Dim x As Long
x = 1 'first page is number 2
SW = ActivePresentation.PageSetup.SlideWidth
SH = ActivePresentation.PageSetup.SlideHeight
Call Killer ' remove old numbers
For Each osld In ActivePresentation.Slides
With osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 20, SH - 45, 20, 20)
.TextFrame2.TextRange = CStr(osld.SlideIndex + x)
.Name = "Mynumber"
End With
With osld.Shapes.AddTextbox(msoTextOrientationHorizontal, SW - 40, SH - 45, 20, 20)
.TextFrame2.TextRange = CStr(osld.SlideIndex + x + 1)
.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
Reply With Quote