Powerpoint

mart1n23

New Member
Joined
Oct 14, 2005
Messages
36
Hello Everyone.

I have a large Powerpoint document.
There is a text box on every slide. I want some code that will number all my slides in these textboxes, even if I have deleted some slides. This means the number of slides can be anything from 2-500!

Please somebody help. Else this is going to drive me mad!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
.

Can do it via code and a special object, but honestly, that's a huge pain in the *** in powerpoint.

Why don't you just use the slide number feature on the Master slides in PowerPoint?

You can also change the starting number as well.

That'll automatically number your slides.

From help in PowerPoint, just search for "slide number".
 
Upvote 0
Here's what i've got so far...

I've written this code to insert a textbox onto every remaining slide in the document.

Code:
Sub Slide_number()

    Dim SL As Slide

    intCounter = 1

    For Each SL In ActivePresentation.Slides
        With SL
            .Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=208.625, Top:=502.5, Width:=181.5, Height:=17).TextFrame _
            .TextRange.Text = "Page Ref: " + Format(((intCounter - 3) * 10), "#000")
        End With
        
        intCounter = intCounter + 1
    Next SL
End Sub

This works lovely, but ideally I want to insert the text into an existing textbox (TextBox4) on every slide rather than create a new one.
If I must create a new one, I need a way to set the font to size 8, and put a line around the textbox.

Can anybody help?
 
Upvote 0
I can't get that to work either.

The document currently has 67 slides, but in the future more will be added. The first page has options that delete slides automatically when a CommandButton is pressed. Once the slides have been deleted I want TextBox4 on every slide to show;

Code:
"Page Ref: " + Format(((Slide.SlideIndex - 3) * 10), "#000")

Can you give me some sample code to get me going please?

That would be a great help.
 
Upvote 0
Ummm, there is no sample code for PowerPoint slide numbers.

Do you understand about Master slides? And objects on Master slides? Specifically the placeholder for slide numbers? PowerPoint help isn't bad about inserting slide numbers into presentation.

You are spending an awful amount of time and energy doing something that is already automated.

If you REALLY want to do it your way, the way to do it would be to insert a weird "invisible" character in your text box.

Your macro then loops through all the slides, then through all the objects on the slide looking for the weird character. If the object is found with the weird character, delete the object. Then insert the object with the weird character with the correct page number.

But that's a lot of code to do something that PowerPoint automatically does.
 
Upvote 0
gwkenny said:
Do you understand about Master slides? And objects on Master slides? Specifically the placeholder for slide numbers?

No, I don't know. I'm fairly new to VB. I don't have anything against the way you're suggesting, I just have no idea how to start.

Could you write some code for me for the following scenario, and I can adapt it.

10 slides in a presentation. The first slide has a Command Button (CommandButton1), and All 10 Slides have a TextBox (TextBox1).
When the Command Button is Pressed, all the Slides are numbered in "TextBox1". If any slides are deleted before the button is pressed, the remaining slides are numbered in the same way.

For example, If slides 5, 6, and 9 were deleted, the remaining slides would be numbered, 1, 2, 3, 4, 5, 6, 7.

This would be a fantastic help.
Thankyou.
 
Upvote 0
Okay.

There is no VB with regards to what you want to do.

Slide numbering is inherent and automatic in PowerPoint if you use the Master Slides.

There is no vb with regards to numbering with Master Slides.

Thus I can not give you any sample code.

PowerPoint help isn't bad about explaining inserting slide numbers into presentation.

PowerPoint help isn't that bad with regards to explaining master slides. Though an average PowerPoint user should be able to explain the concept to you.

My suggestion is to drop VB in this case, and look around for education on Master Slides in PowerPoint and Slide Numbering.

Best of luck to yah.
 
Upvote 0

Forum statistics

Threads
1,224,856
Messages
6,181,427
Members
453,040
Latest member
Santero

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top