MS Office Forum / General PowerPoint Questions / March 2005
code to goto tagged slide
|
|
Thread rating:  |
andy - 08 Mar 2005 15:21 GMT 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.
David M. Marcovitz - 08 Mar 2005 15:57 GMT 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
 Signature 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/
"andy" <anonymous@discussions.microsoft.com> wrote in news:5b9801c523f2 $7605da40$a401280a@phx.gbl:
> Could someone please help! > I would like to know how to VBA code PP (2000) so that [quoted text clipped - 22 lines] > such as an embedded object that the code would search for, > that would be OK too. andy - 08 Mar 2005 19:23 GMT 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
>-----Original Message----- >Capturing the keystrokes is the key (no pun intended) thing I don't know [quoted text clipped - 42 lines] > >. David M. Marcovitz - 08 Mar 2005 19:38 GMT 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
 Signature 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/
"andy" <anonymous@discussions.microsoft.com> wrote in news:58c201c52414 $5a8db770$a601280a@phx.gbl:
> Thank you David for your reply. > On your website, it states that the proceedure cannot be [quoted text clipped - 77 lines] >> >>. andy - 08 Mar 2005 21:05 GMT 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!
>-----Original Message----- >The procedures for naming shapes and slides on my site are meant to only [quoted text clipped - 110 lines] > >. David M. Marcovitz - 09 Mar 2005 01:01 GMT 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/
> Again, thank you for sharing your expertise. > I would know ahead of time which slides get names, and the [quoted text clipped - 160 lines] > > > >. andy - 09 Mar 2005 15:51 GMT 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
>-----Original Message----- >The procedures for naming shapes and slides on my site are meant to only [quoted text clipped - 110 lines] > >. David M. Marcovitz - 09 Mar 2005 16:09 GMT 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
 Signature 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/
"andy" <anonymous@discussions.microsoft.com> wrote in news:4bf501c524bf $dc073320$a501280a@phx.gbl:
> Dave, I used the addin that Steve suggested and thank God > it works wonderfully. Two considerations though, first of [quoted text clipped - 24 lines] > > Thanks, andy andy - 10 Mar 2005 19:51 GMT 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
>-----Original Message----- >Actually, I was referring to having the button be invisible that [quoted text clipped - 40 lines] >> Thanks, andy >. David M. Marcovitz - 10 Mar 2005 20:00 GMT Good question, but I don't know the answer. Perhaps someone else knows. --David
 Signature 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/
"andy" <anonymous@discussions.microsoft.com> wrote in news:6cca01c525aa $8d2530e0$a601280a@phx.gbl:
> 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 Steve Rindsberg - 08 Mar 2005 21:15 GMT > Also, I know this is not based on any fact, but I would > think that since I can (in presentation mode) type in on [quoted text clipped - 3 lines] > 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
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
David M. Marcovitz - 09 Mar 2005 00:55 GMT This doesn't work in Slide Show View, does it? --David
David Marcovitz Author of _Powerful PowerPoint for Educators_ http://www.loyola.edu/education/PowerfulPowerPoint/
> > Also, I know this is not based on any fact, but I would > > think that since I can (in presentation mode) type in on [quoted text clipped - 15 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 09 Mar 2005 16:49 GMT > This doesn't work in Slide Show View, does it? Ah. I don't know. Sounds like you have it? If you say no, I believe ya. <g>
> --David > [quoted text clipped - 21 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
David M. Marcovitz - 09 Mar 2005 17:16 GMT >> This doesn't work in Slide Show View, does it? > > 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
 Signature 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/
Chirag - 09 Mar 2005 17:11 GMT Yes, it works in Slide Show View too.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously http://officeone.mvps.org/powershow/powershow.html
> This doesn't work in Slide Show View, does it? > --David [quoted text clipped - 22 lines] >> PPTools: www.pptools.com >> ================================================
|
|
|