Current Slide Number

G

Guest

I am using the following code to reset the slides when a user clicks on my
navigation buttons.

Sub ResetSlide1()

' The number after GotoSlide is the slide number.
SlideShowWindows(1).View.GotoSlide 1, msoTrue

End Sub

However, I need to use a unique sub routine for each page in my
presenatation. I was thinking that if I knew the current slide number I
could just add 1 or subtract 1 from that and use that as the page number for
the GotoSlide command.
That way one subroutine would work for my entrire presenation.

Is that possible?

Thanks!
- Kurt
 
C

Chirag

For creating navigation buttons, you can set the action settings for the
shapes on the slide. Do the following:
1. Select the shape that would take you to previous slide.
2. Select "Slide Show" | "Action Settings..." menu item.
3. Select "Previous Slide" in "Hyperlink to" box.
4. Click OK.

No need to use any macro and it will work in the free PowerPoint Viewer too.
The link to first slide can also be set through a similar procedure.

If you want to use macros in any case, the following macro will take you to
the previous slide:
---
Sub GotoPreviousSlide()
SlideShowWindows(1).View.Previous
End Sub
---

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
G

Guest

Hi Kurt,
Use the following

snum = SlideShowWindows(1).View.Slide.SlideIndex

snum will be the number of the slide that is showing

Regards,
Tim
 
G

Guest

Hi Kurt,
snum = SlideShowWindows(1).View.Slide.SlideIndex
snum will be the number of the current slide and from there you should be OK.

Regards,
Timothius
 
G

Guest

Thanks Tim! This is exactly what I need.

Timothius said:
Hi Kurt,
Use the following

snum = SlideShowWindows(1).View.Slide.SlideIndex

snum will be the number of the slide that is showing

Regards,
Tim
 
G

Guest

Thank you Chirag. However, I need the macro code that I am using to reset
the slide. Otherwise Powerpoint plays the slide from where it left off and
not at the beginning of the slide animations.

Tim's answer solves my problem.
- Kurt
 
G

Guest

I tried the VBA Code you suggested and I get an error.

I am using PowerPoint 2000 sp3

This is my code:
Set oPPT = GetObject(, "PowerPoint.Application")

sn = oPPT.SlideShowWindows(1).View.Slide.SlideIndex

The error I get is:
"SlideShowWindows (Unknow member): Integer outof range. 1 is not in the
valid range of 1 to 0.

Can someone help!!!

Gary
 
S

Steve Rindsberg

I tried the VBA Code you suggested and I get an error.

I am using PowerPoint 2000 sp3

This is my code:
Set oPPT = GetObject(, "PowerPoint.Application")

You'd also need to open a presentation and put it into slide show view before this
code would work:
 
S

Scott

So what is the way to get the current slide number in design view (not in
slide show mode) ? Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top