Macro to determine which file linked me to this file (to enable macro to return to it)

K

K J Boland

Hello there.

I'm in PPT 2003.

I want to branch from one presentation to another, look at maybe two or
three slides from the second presentation and then jump back to the parent
ppt. (without shutting the second ppt, as I may jump back to it again later)

If I use the Actionproperties "previously seen" this does not work beyond
the first slide in the second ppt.

Therefore the question : is there a way in VBA to note the name and address
of the link which sent me to that new ppt, inorder to create a macro button
which would allow me to return to the initiating ppt ?

I seem to remember (but not the details) that something like this was
possible with vba in excel.

thanks
 
G

Guest

I think that this is possible without vba

Have all slides in one show (bear with me !)
Create several custom shows for each "separate presentation you want to link
to (slide show > custom shows > new)
Now create hyperlinks to the custom show in action settings > tick "show &
return"
In the custom shows add an action button to every slide (copy & paste) with
action "end show" (note this will end the custom show)

You can show any number of slides in the custom show and return to where you
came from by clicking the action button.

Set slide transitions in the main show so that you cant click advance to the
custom shows.
--
 
S

Steve Rindsberg

Hello there.

I'm in PPT 2003.

I want to branch from one presentation to another, look at maybe two or
three slides from the second presentation and then jump back to the parent
ppt. (without shutting the second ppt, as I may jump back to it again later)

If the second show is relatively small and opens quickly, it might be far
simpler just to let it close (ie, use an End Show button to get it out of the
way and return to the primary show.)
 
K

K J Boland

John,

thanks for that. However, I think I really need the VBA solution. I am using
PPT more as an online tutorial manual (rather than say Acrobat, which is no
good due to our base information linking to the presentation) I could
therefore have 20 presentations, each with say 40 slides, and each linking
to other "base" presentations.

The only real solution is therefore in VBA. In addition, I would like to
develop the VBA route as a learning exercise.

thanks,

kim
 
S

Steve Rindsberg

Hello there.

I'm in PPT 2003.

I want to branch from one presentation to another, look at maybe two or
three slides from the second presentation and then jump back to the parent
ppt. (without shutting the second ppt, as I may jump back to it again later)

If I use the Actionproperties "previously seen" this does not work beyond
the first slide in the second ppt.

Therefore the question : is there a way in VBA to note the name and address
of the link which sent me to that new ppt, inorder to create a macro button
which would allow me to return to the initiating ppt ?

Off top of head, suppose you implement an event handler that triggers on slide
changes during a slide show.

On each change, you'd add an entry to a "stack" (list of slides visited,
including both presentation name and slide index)

To go back, you'd write a macro and assign your go back button to it. The
macro could track back up the stack until it finds the first entry where the
presentation name doesn't match the name of the current active presentation,
then go to that presentation, to the slide index indicated.

You could use the same stack to implement real Back and Forward buttons to use
in place of PPT's Last Viewed, which is generally not very useful.
 
K

K J Boland

Steve, thanks for that....

As another idea----

I think what I really need to do (in the first instance for simplicity as a
novice vba writer, is to take your own macro "go there, come back" and get
it to tell me the info I need to jump across presentations.

As a novice... I'd appreciate any advice you could give on how to change
this in the shortest way... I've tried some loops to get the active window,
but it all seems to get lost by the time it jumps to the linked file.



Sub RememberWhere()

' Make the MOUSEOVER action of your navigation buttons run this

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

End Sub

Sub GoBack()

' Make this the MOUSECLICK action of the Return to button

SlideShowWindows(1).View.GotoSlide (ReturnToSlide) End Sub
 
K

K J Boland

I modified some code which works when I hard code in the source file.
However I want the name and SlideNumber to come from the original
presentation. The variables appear to be lost once they go to a new
presentation. (They are declared Public)

Is there a way to pass variables from one presentation to another WITHOUT
knowing in advance what the name of the first presentation is (I can't
therefore use a function call back to the first presentation)?
 

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