PDA

View Full Version : Navigation Using FindBySlideID Method



David Tay
03-18-2006, 02:54 AM
Apologies if this question seems too easy but I'm truly new to VBA.

How can I use the FindBySlideID method to navigate from a shape that has been clicked on to another slide?

I've tried the Microsoft help but it seems to be used for another purpose.

If the FindBySlideID method is not appropriate for this purpose, how can I direct the powerpoint user to the appropriate slide on clicking the shape?

Thanks!

Killian
03-28-2006, 08:49 AM
Hi David,

You don't need VBA to do this. With your shape selected, go to
Slide Show>Action Settings
and on the Mouse Click tab, choose "Hyperlink to..", select "Slide..." and select the slide you want to jump to

HTH

David Tay
03-28-2006, 04:44 PM
Thanks for responding!

Actually, I was hoping to have the user click on a shape that represents one of the answers to a question. The action setting will then be activated to run a sub that will navigate to the specific slide and at the same time activate a scoring variable.

Am I making life too difficult for myself? Should I just do a sub for scoring and use the hyperlink method you suggested for navigational purposes?

Appreciate your taking the time to respond to a novice's query.

Killian
03-29-2006, 02:05 AM
Should I just do a sub for scoring and use the hyperlink method you suggested for navigational purposes?Probably the easiest approach.

David Tay
03-29-2006, 02:50 AM
Guess that's what it has to be then! :(

I was actually thinking of using the slideid for navigational purposes as it seems to be a constant for a specific slide in contrast to the slide index which changes with its position. Guess I will have to give meaningful names to the slides and then use the names for navigational references.

Thanks for the input.

Killian
03-30-2006, 01:26 AM
Well its true that the SlideID is a fixed property and if it's more convenient to navigate that way, then it's not a problem - it just seems redundant to code it.

To navigate, you need to use GoToSlide, which requires a slide index. FindBySlideID returns a slide object, so you can use it's SlideIndex propertyActiveWindow.View.GotoSlide ActivePresentation.Slides.FindBySlideID("256").SlideIndex

David Tay
03-31-2006, 05:10 AM
Appreciate the help but wonder how to use suggested code in a sub so that when a textbox is clicked the action setting will navigate to, say, SlideID 4?

Sub GotoUsingSlideID3()
'
' Macro created 01/04/2006 by David Tay
'
ActiveWindow.View.GotoSlide ActivePresentation.Slides.FindBySlideID("256").SlideIndex
End Sub
What does ("256") in FindBySlideID mean?

Here's hoping you aren't too busy!

Thanks,
David

Killian
03-31-2006, 05:43 AM
Well this is why using action settings is easier, since you don't normally have events to trigger code in PowerPoint. (You can create an addin that allows you to enable application events).
The other option is to use activex controls in the presentation, I suppose, but I can't help thinking it's just over complicating things.

The "256" in my example id the ID of the slide to navigate to, so you'd just edit that accordingly.