code to goto tagged slide

A

andy

Could someone please help!
I would like to know how to VBA code PP (2000) so that
when in presentation mode if a certain keystroke is
pressed, that the presentation would go to a tagged slide.
Below is an example of what I would like to happen, if
possible please show me the code, and what event to place
it under would look like. Thank you in advance.

Slide 1 blank
Slide 2 (tagged with a text box, text = "v1")
Slide 3 text content
Slide 4 text content
Slide 5 (tagged with a text box, text = "c1")
Slide 6 text content
Slide 7 (tagged with a text box, text = "v2")

In presentation mode, no matter what slide is currently
being displayed, if for example the presenter presses the
keyboard keys "v1" and enter, the presentation would goto
slide 2. If "c1" and enter, the presentation would goto
slide 5. The catch is, that the v1, c1, v2, or
other "tags" could be in different places in similar
presentations however, the same linked behaviour is
desired. If someother "tag" is necessary to make this work
such as an embedded object that the code would search for,
that would be OK too.
 
D

David M. Marcovitz

Capturing the keystrokes is the key (no pun intended) thing I don't know
how to do. If it can be done, it would have to happen with an addin, and
that would have to be loaded on each presenation.

Once you capture the keystrokes (or if you give up and put a menu on each
slide), going to the slide is easy. Your best bet might be to name the
slides. See Example 8.7 on my site for code to name a slide:

http://www.loyola.edu/education/PowerfulPowerPoint/

Then you could go to the slide with the following code:

theSlideIndex = ActivePresentation.Slides("v1").SlideIndex
ActivePresentation.SlideShowWindow.View.GotoSlide theSlideIndex

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
A

andy

Thank you David for your reply.
On your website, it states that the proceedure cannot be
run in presentation mode, is that correct?

Also, I know this is not based on any fact, but I would
think that since I can (in presentation mode) type in on
the keyboard a number, hit enter and it will take me tha
that slide, that hopefully this mechinism could be altered
so that when a key, or key cobo is typed in and enter is
hit, that the action could be altered to look for a slide
name rather than a slide number.

Also, I first wanted to see if I could assign a 'short cut
key' to a macro, like you can in Excel, and I was
surprised to see that there is no spot to assign a 'short
cut key' when you record a new macro.

Thanks. Any additional help is greatly appreciated.
Perhaps I'll post specifically if anyone has assigned a
macro to a short cut key (or combo). Andy
 
D

David M. Marcovitz

The procedures for naming shapes and slides on my site are meant to only
work in Edit/Normal View. However it should be pretty easy to name a
slide in Slide Show View with something along the lines of:

ActivePresentation.SlideShowWindow.View.Slide.Name = ...

to name the current slide.

The difficulty with naming shapes is that you can't select anything in
Slide Show view so your code has to know which shape you are naming. If
you already know which shape you are naming, then you don't necessarily
need to name it.

There are many mechanisms within PowerPoint that can't be tapped (or
easily tapped) with code. It seems like it should be easy to change the
feature that lets you type a slide number, but I don't think you can.

It would be easy to write a procedure that pops up an InputBox and asks
you which slide you want to go to at which point you can type v1 to go to
that named slide. This would require only one button on each slide (it
could even be transparent so no one would know it was there), and it
wouldn't be much uglier than just typing the slide number, just a little
uglier.

mySlideName = InputBox("Type the slide to which you want to go.")

followed by the code I sent earlier, replacing "v1" with mySlideName.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
A

andy

Again, thank you for sharing your expertise.
I would know ahead of time which slides get names, and the
names can stay the same throughout using the .ppt somewhat
like a template, however the placement of the named slides
it what would change. I assume you are saying that I can
name them in design mode, as I saw in your web example,
and call them via button activated input box.
This sound fine to me. How would I activate the button,
and you mentioned it could be hidden (transparent)? Can I
assign a $Title to the button name to cause it to be a
keyboard shortcut key, and have it activate when Alt/T or
whatever is pushed, then the presenter would know that
they would have to follow the activation by typing
e.g. 'V1' which would take them to the predetermined slide
named such?
If so could you please elaborate some on how to accomplish
this, and in the mean time I will test what you have given
me. Thanks again!
 
S

Steve Rindsberg

Also, I know this is not based on any fact, but I would
think that since I can (in presentation mode) type in on
the keyboard a number, hit enter and it will take me tha
that slide, that hopefully this mechinism could be altered
so that when a key, or key cobo is typed in and enter is
hit, that the action could be altered to look for a slide
name rather than a slide number.

You'd think, wouldn't you? But alas, it's not so.

Chirag Dalal has an addin that lets you add shortcuts though:

http://officeone.mvps.org/ppsctmgr/ppsctmgr.html
 
G

Guest

I think you have everything right. Unfortunately, trapping keystrokes is the
sticking point, but you are on track to providing a small, hidden, or
transparent button that will pop up an InputBox that will let you jump to a
named slide.
--David

David Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
A

andy

Dave, I used the addin that Steve suggested and thank God
it works wonderfully. Two considerations though, first of
all, it is a 30 day demo, and then a single user licence
costs $25, however this would be worth it! The second
consideration is, it would not allow me to assign a two
character shortcut code to the macro (e.g. I wanted to use
v1, v2, v3, c1, c2, c3, etc.) however I got around that by
the following:

mySlideName = InputBox("")
theSlideIndex = ActivePresentation.Slides("v" &
mySlideName).SlideIndex
ActivePresentation.SlideShowWindow.View.GotoSlide
theSlideIndex

I assigned the keystroke 'V' to the above macro, so that
in presentation mode the assigned macro pops up the
InputBox which accepts the keyboard input. So the
presenter can type v2, press enter, and go to that slide
directly.

I think my only remaining hangup is to hide the InputBox
so that it is not visible when the 'v' keystroke calls the
macro, and is executed. You mentioned doing this earlier,
please tell me how to 'hide' the InputBox and still have
it function. I tried some things which didn't work.

Thanks, andy
 
D

David M. Marcovitz

Actually, I was referring to having the button be invisible that
activates the InputBox, but now you don't need the button. However, you
can hide the InputBox by changing the code in the following way:

mySlideName = InputBox(prompt:="", xpos:=-3000, ypos:=-3000)

This will set your InputBox to show up off screen so no one can see it.

Also, remember that an addin goes with the machine, not the presentation,
so if you take the presentation to another machine, it will need the
addin installed there.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
D

David M. Marcovitz

Ah. I don't know. Sounds like you have it? If you say no, I believe
ya. <g>

Nope. I don't have it, but the original questioner has it, and it seemed
to work for him, so I guess I was wrong, and it does work in Slide Show
View.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
A

andy

one more question on topic, inbetween the keystroke, and
the inputbox, the arrow/mouse cursor pops into the slide.
Is there a way to hide the cursor? and then restore it if
it is apporpriate. Perhaps something like
screen.mousepointer = ???
Thanks
 

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