PDA

View Full Version : Solved: add textbox with page numbering in groups of three



pir81
08-17-2011, 01:13 PM
Hello,

I need to number a few hundred slides in groups of three in the following pattern:

L1 (first slide)
C1 (second slide)
R1 (third slide)
L2 (fourth slide)
C2 (fifth slide)
R2 (sixth slide)
L3... you get the picture

It is always L,C,R with increasing numbers after 3rd slide.

I would like to add a box with Arial 20, bold, italic into the right bottom corner (left bottom text box corner at 9.4 horizontal and 11 vertical), but just realized there is no "record macro" in powerpoint 2010.

Can someone please help me.

Thank you in advance.

John Wilson
08-18-2011, 12:51 AM
This should change the slide number as you wish. You should set the style for the number on the slide master

Sub nums()
'set the text style on the master for the slide number
Dim lngIndex As Long
Dim lngNum As Long
lngNum = 1
For lngIndex = 1 To ActivePresentation.Slides.Count
ActivePresentation.Slides(lngIndex).HeadersFooters.SlideNumber.Visible = True
GetSN(ActivePresentation.Slides(lngIndex)).TextFrame.TextRange = CStr(lngNum)
'Slide Index is exact multiple of 3
If lngIndex / 3 = lngIndex \ 3 Then lngNum = lngNum + 1
Next
End Sub
Function GetSN(osld As Slide) As Shape
Dim oshp As Shape
For Each oshp In osld.Shapes
If oshp.Type = msoPlaceholder Then
If oshp.PlaceholderFormat.Type = ppPlaceholderSlideNumber Then
Set GetSN = oshp
Exit For
End If
End If
Next
End Function

pir81
08-20-2011, 02:34 AM
John, thank you very much!