hyperlink that refers to previous referring slide?

J

just-dancing-jo

I am using Powerpoint 97 (yes, I'm in the dark ages).

I want to create hyperlinks (or vba or anything else available to that
version) that will take me to the original referring page.

For example, assume I have a content slide, that has links to slides 2, 3,
4, and 5. slide 2, 3, and 4 each have a link to slide 6. there is a link on
slide 6 to slide 7. If I hyperlink to "last slide viewed" on slide 7, it
takes me to slide 6. All good and well. Now, I want to click a "back
button" on slide 6, but end up at slide 2, 3 or 4, whichever one I was on
when I went to slide 6. The hyperlink action "last slide viewed" won't do
that -- it will take me back to slide 7 again.

Is this doable in Powerpoint? Or do I need a different ap?

TIA
 
D

David Marcovitz

You are correct about the functioning of the Last Slide Viewed feature;
it does not function like a Back button. I think you would need VBA in
order to do this. I don't think the code would be too difficult, but I
don't have any handy. I'm thinking that the best way to do this would be
to add a tag to each slide with the number of the referring slide. The
BACK button would simply check the tag on the slide and

ActivePresentation.SlideShowWindow.View.GotoSlide theReferringSlide

The slightly complex part would be for each hyperlink to call a
procedure that goes to the appropriate slide and sets the tag for that
slide.

I wonder if someone already has an add-in that does this.

--David
 
D

David Marcovitz

Steve Rindsberg said:
It would be simpler in later versions of PPT where you could use event
trapping to add each slide to a list as it's visited and have the Back
button work its way up the list. But events aren't supported in '97.

If you used VBA to handle the links between slides rather than normal
action buttons, it might work.

Hmm. So if you draw a button or whatever, tag it with the number of the
slide you want to jump to (using the TagJumpShape macro below) then assign
an action setting of Run Macro: JumpTo

then

For the back button assign a Run Macro: BackButton

it all sorta works. Might even work if tested rigourously. Which I
haven't. <g>



Option Explicit

Public aJumpList() As Long
Public lCurrentPointer As Long

Sub BackButton()
If lCurrentPointer > 0 Then
SlideShowWindows(1).View.GotoSlide (aJumpList(lCurrentPointer))
lCurrentPointer = lCurrentPointer - 1
End If
End Sub

Sub JumpTo(oSh As Shape)
If oSh.Tags("JUMPTO") <> "" Then

' add the jump to target to our list
' 97 may error here if the array is empty so
On Error Resume Next
ReDim Preserve aJumpList(1 To UBound(aJumpList) + 1)
If Err.Number <> 0 Then
ReDim aJumpList(1 To 1)
End If

lCurrentPointer = lCurrentPointer + 1

aJumpList(UBound(aJumpList)) =
SlideShowWindows(1).View.Slide.SlideIndex

' go there
SlideShowWindows(1).View.GotoSlide (CLng(oSh.Tags("JUMPTO")))

End If

End Sub

Sub TagJumpShape()
' run this from design mode.
' select the shape first

Dim lJumpTo As Long
lJumpTo = InputBox("Slide number to jump to", "Jump To")
If lJumpTo > 0 Then
With ActiveWindow.Selection.ShapeRange(1)
.Tags.Add "JUMPTO", CStr(lJumpTo)
End With
End If
End Sub

Sub ResetJumpList()
ReDim aJumpList(1 To 1)
End Sub


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


I'm sure this will work, but I thought it would be simpler to assign the
tag to the slide (or am I mistaken and slides can't have tags). That
way, you don't even a need a Jumplist. Instead, just look at the tag of
the current slide to find out where to go. Aha, but that would fail if
you go to the same slide more than once. Nevermind.
--David
 
J

just-dancing-jo

Cool beans. I shall give it a try and let you know what happens. It may be
awhile as this is a background sort of project. Thanks for the input!

j
 

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