|
View Full Version : vba - how to adapt macro recorded code?
Geoff Cox 10-12-2006, 09:20 AM Hello,
I am trying to add a last slide which has an EndShow action button
covering the whole slide - to avoid the black screen etc.
This code adds a slide after the current last slide (the +1 bit is my
idea - there must be a better way to add after the last curretn
slide?!).
With oPresentation
Dim oSlide As Slide
Set oSlide = oPresentation.Slides.add(ActivePresentation
_.Slides.Count + 1, PowerPoint.PpSlideLayout.ppLayoutBlank)
End With
So far so good - but how do I add the EndShow button etc? The macro
recorder gives me the following but I do not understand how to apply
it to the above new slide. Help!
Cheers
Geoff
ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeActionButtonEnd,
0#, 0#, 720#, 540#).Select
With
ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
.Action = ppActionEndShow
.SoundEffect.Type = ppSoundNone
.AnimateAction = msoTrue
End With
With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseOver)
.Action = ppActionNone
.SoundEffect.Type = ppSoundNone
.AnimateActi
David M. Marcovitz 10-12-2006, 02:41 PM Something like this should work:
Set oShp = ActivePresentation.Slides(ActivePresentation.Slides.Count) _
.Shapes.AddShape(msoShapeActionButtonEnd, 0#, 0#, 720#, 540#)
With oShp.ActionSettings(ppMouseClick)
.Action = ppActionEndShow
.SoundEffect.Type = ppSoundNone
.AnimateAction = msoTrue
End With
--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Geoff Cox <geoff.cox@remove-this.freeuk.com> wrote in
news:7curi2h5giih1m1bvhda52sjk8ea21icht@4ax.com:
> Hello,
>
> I am trying to add a last slide which has an EndShow action button
> covering the whole slide - to avoid the black screen etc.
>
> This code adds a slide after the current last slide (the +1 bit is my
> idea - there must be a better way to add after the last curretn
> slide?!).
>
> With oPresentation
>
> Dim oSlide As Slide
>
> Set oSlide = oPresentation.Slides.add(ActivePresentation
> _.Slides.Count + 1, PowerPoint.PpSlideLayout.ppLayoutBlank)
>
>
> End With
>
> So far so good - but how do I add the EndShow button etc? The macro
> recorder gives me the following but I do not understand how to apply
> it to the above new slide. Help!
>
> Cheers
>
> Geoff
>
> ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeActionButtonE
> nd, 0#, 0#, 720#, 540#).Select
> With
> ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
> .Action = ppActionEndShow
> .SoundEffect.Type = ppSoundNone
> .AnimateAction = msoTrue
> End With
> With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseOver)
> .Action = ppActionNone
> .SoundEffect.Type = ppSoundNone
> .AnimateActi
>
Geoff Cox 10-12-2006, 03:22 PM On Thu, 12 Oct 2006 06:41:33 -0700, "David M. Marcovitz"
<marcoNOSPAM@loyola.edu> wrote:
>Set oShp = ActivePresentation.Slides(ActivePresentation.Slides.Count) _
> .Shapes.AddShape(msoShapeActionButtonEnd, 0#, 0#, 720#, 540#)
>With oShp.ActionSettings(ppMouseClick)
> .Action = ppActionEndShow
> .SoundEffect.Type = ppSoundNone
> .AnimateAction = msoTrue
>End With
David,
Thanks - that works fine. I wonder if you know anything about the
removal of the black screen?
Your code works fine when using Package for CD onto the hard disk but
onto a CD and a mouse click is OK (you go to previous ppt file) but
pressing the enter key gives the black screen!
From a while back the MS answer seemed to be that you just have to
live with this. This still the case?
Cheers
Geoff
Geoff Cox 10-12-2006, 03:27 PM On Thu, 12 Oct 2006 15:22:30 +0100, Geoff Cox
<geoff.cox@remove-this.freeuk.com> wrote:
>On Thu, 12 Oct 2006 06:41:33 -0700, "David M. Marcovitz"
><marcoNOSPAM@loyola.edu> wrote:
>
>>Set oShp = ActivePresentation.Slides(ActivePresentation.Slides.Count) _
>> .Shapes.AddShape(msoShapeActionButtonEnd, 0#, 0#, 720#, 540#)
>>With oShp.ActionSettings(ppMouseClick)
>> .Action = ppActionEndShow
>> .SoundEffect.Type = ppSoundNone
>> .AnimateAction = msoTrue
>>End With
isn't it possible to trap the enter key somehow by adding a line above
so that the enter key has the same action as clicking the mouse?
Geoff
>
>David,
>
>Thanks - that works fine. I wonder if you know anything about the
>removal of the black screen?
>
>Your code works fine when using Package for CD onto the hard disk but
>onto a CD and a mouse click is OK (you go to previous ppt file) but
>pressing the enter key gives the black screen!
>
>From a while back the MS answer seemed to be that you just have to
>live with this. This still the case?
>
>Cheers
>
>Geoff
Geoff Cox 10-12-2006, 03:37 PM On Thu, 12 Oct 2006 06:41:33 -0700, "David M. Marcovitz"
<marcoNOSPAM@loyola.edu> wrote:
>Something like this should work:
>
>
>Set oShp = ActivePresentation.Slides(ActivePresentation.Slides.Count) _
> .Shapes.AddShape(msoShapeActionButtonEnd, 0#, 0#, 720#, 540#)
>With oShp.ActionSettings(ppMouseClick)
> .Action = ppActionEndShow
> .SoundEffect.Type = ppSoundNone
> .AnimateAction = msoTrue
>End With
David,
Just realised that there is a problem! - I need to add the above
effect not to the last slide but to a new additional slide at the end
of the presentation ... your code overwrites my current last slide.
My code below with the +1 bit does this but do you see any possible
corrections/improvement to it?!
Geoff
Set oSl = oPresentation.Slides.Add(ActivePresentation.Slides.Count + _
1, PowerPoint.PpSlideLayout.ppLayoutBlank)
Set oSh2 = oSl.Shapes.AddShape(Type:=msoShapeActionButtonEnd, _
Left:=0, Top:=0, Width:=730, Height:=550)
oSh2.TextFrame.TextRange.Text = "Next"
oSh2.TextFrame.TextRange.Font.Size = 80
oSh2.ActionSettings(ppMouseClick).Action = ppActionEndShow
David M. Marcovitz 10-12-2006, 03:44 PM Geoff, my code was to add the button to the last slide. This was meant to
come after your code that added a new blank slide, so you just put my
code after yours, and it should work.
As far as the black slide issue goes, I believe that is a setting on each
individual computer (not each presentation) so if the computer has
PowerPoint settings to end on a black slide, then it will.
--David
--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Geoff Cox <geoff.cox@remove-this.freeuk.com> wrote in
news:4iksi2lgelf68g0a3o1mio0tjchc2cob32@4ax.com:
> On Thu, 12 Oct 2006 06:41:33 -0700, "David M. Marcovitz"
> <marcoNOSPAM@loyola.edu> wrote:
>
>>Something like this should work:
>>
>>
>>Set oShp = ActivePresentation.Slides(ActivePresentation.Slides.Count) _
>> .Shapes.AddShape(msoShapeActionButtonEnd, 0#, 0#, 720#, 540#)
>>With oShp.ActionSettings(ppMouseClick)
>> .Action = ppActionEndShow
>> .SoundEffect.Type = ppSoundNone
>> .AnimateAction = msoTrue
>>End With
>
> David,
>
> Just realised that there is a problem! - I need to add the above
> effect not to the last slide but to a new additional slide at the end
> of the presentation ... your code overwrites my current last slide.
>
> My code below with the +1 bit does this but do you see any possible
> corrections/improvement to it?!
>
> Geoff
>
> Set oSl = oPresentation.Slides.Add(ActivePresentation.Slides.Count + _
> 1, PowerPoint.PpSlideLayout.ppLayoutBlank)
>
> Set oSh2 = oSl.Shapes.AddShape(Type:=msoShapeActionButtonEnd, _
> Left:=0, Top:=0, Width:=730, Height:=550)
> oSh2.TextFrame.TextRange.Text = "Next"
> oSh2.TextFrame.TextRange.Font.Size = 80
> oSh2.ActionSettings(ppMouseClick).Action = ppActionEndShow
>
Geoff Cox 10-12-2006, 07:36 PM On Thu, 12 Oct 2006 07:44:53 -0700, "David M. Marcovitz"
<marcoNOSPAM@loyola.edu> wrote:
>Geoff, my code was to add the button to the last slide. This was meant to
>come after your code that added a new blank slide, so you just put my
>code after yours, and it should work.
David,
OK - will check that again.
>As far as the black slide issue goes, I believe that is a setting on each
>individual computer (not each presentation) so if the computer has
>PowerPoint settings to end on a black slide, then it will.
Yes, but I am concerned re those folk that do not have PPT on their
PC!
When using Package for CD onto the hard disk I would prefer to have
added only those facilities which will work when Package for CD is
used to prepare an actual CD!! Seems logical?!
Cheers
Geoff
>--David
Steve Rindsberg 10-12-2006, 11:02 PM > >As far as the black slide issue goes, I believe that is a setting on each
> >individual computer (not each presentation) so if the computer has
> >PowerPoint settings to end on a black slide, then it will.
>
> Yes, but I am concerned re those folk that do not have PPT on their
> PC!
>
> When using Package for CD onto the hard disk I would prefer to have
> added only those facilities which will work when Package for CD is
> used to prepare an actual CD!! Seems logical?!
If your presentation's in Kiosk mode and there's an End Show button on your own
last slide, they should never see the pseudo-pslide that MS pso rudely
inpserts.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Geoff Cox 10-13-2006, 12:13 AM On Thu, 12 Oct 2006 18:02:50 EDT, Steve Rindsberg
<abuse@localhost.com> wrote:
>
>> >As far as the black slide issue goes, I believe that is a setting on each
>> >individual computer (not each presentation) so if the computer has
>> >PowerPoint settings to end on a black slide, then it will.
>>
>> Yes, but I am concerned re those folk that do not have PPT on their
>> PC!
>>
>> When using Package for CD onto the hard disk I would prefer to have
>> added only those facilities which will work when Package for CD is
>> used to prepare an actual CD!! Seems logical?!
>
>If your presentation's in Kiosk mode and there's an End Show button on your own
>last slide, they should never see the pseudo-pslide that MS pso rudely
>inpserts.
Steve,
I think I am correct in thinking that kiosk mode means:
1. each slide must have a hyperlink to move to the next slide?
2. animation not possible using mouse click or enter key - must happen
using a time interval?
I guess this removes too much user control in that it is part of our
approach to get a student to work out an answer before having the
correct answers appear using the mouse or the enter key.
How much simpler to have a less rude end slide!
Cheers
Geoff
>-----------------------------------------
>Steve Rindsberg, PPT MVP
>PPT FAQ: www.pptfaq.com
>PPTools: www.pptools.com
>================================================
>
Steve Rindsberg 10-13-2006, 04:11 AM > >If your presentation's in Kiosk mode and there's an End Show button on your own
> >last slide, they should never see the pseudo-pslide that MS pso rudely
> >inpserts.
>
> Steve,
>
> I think I am correct in thinking that kiosk mode means:
>
> 1. each slide must have a hyperlink to move to the next slide?
Correct. Or rather, some shape with a hyperlink/action setting must appear on each
slide (it can come from the slide master)
> 2. animation not possible using mouse click or enter key - must happen
> using a time interval?
Hmm. Or via triggers.
> I guess this removes too much user control in that it is part of our
> approach to get a student to work out an answer before having the
> correct answers appear using the mouse or the enter key.
>
> How much simpler to have a less rude end slide!
How much I agree!
>
> Cheers
>
> Geoff
>
> >-----------------------------------------
> >Steve Rindsberg, PPT MVP
> >PPT FAQ: www.pptfaq.com
> >PPTools: www.pptools.com
> >================================================
> >
>
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Geoff Cox 10-13-2006, 08:00 AM On Thu, 12 Oct 2006 23:11:29 EDT, Steve Rindsberg
<abuse@localhost.com> wrote:
>> 2. animation not possible using mouse click or enter key - must happen
>> using a time interval?
>
>Hmm. Or via triggers.
Steve,
Re the trigger approach - I have tried the "start after previous" and
that will cause soem words to move into the "correct" places.
But, is it possible to use a trigger so that the words only start to
move when the user decides that they should?
Cheers
Geoff
>
>> I guess this removes too much user control in that it is part of our
>> approach to get a student to work out an answer before having the
>> correct answers appear using the mouse or the enter key.
>>
>> How much simpler to have a less rude end slide!
>
>How much I agree!
>
>>
>> Cheers
>>
>> Geoff
>>
>> >-----------------------------------------
>> >Steve Rindsberg, PPT MVP
>> >PPT FAQ: www.pptfaq.com
>> >PPTools: www.pptools.com
>> >================================================
>> >
>>
>
>-----------------------------------------
>Steve Rindsberg, PPT MVP
>PPT FAQ: www.pptfaq.com
>PPTools: www.pptools.com
>================================================
>
David M. Marcovitz 10-13-2006, 02:45 PM Yes, that's what trigger animations are all about, but they only work in
2002 and above. You can find triggers under the Timing option of the
animation effects for a particular animation. It will allow a click to
cause the specified animation to happen only when a particular object is
clicked.
--David
--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Geoff Cox <geoff.cox@remove-this.freeuk.com> wrote in
news:37eui29okbjrqvjbrbn3s2jdcfoji3ljo9@4ax.com:
> On Thu, 12 Oct 2006 23:11:29 EDT, Steve Rindsberg
> <abuse@localhost.com> wrote:
>
>>> 2. animation not possible using mouse click or enter key - must
happen
>>> using a time interval?
>>
>>Hmm. Or via triggers.
>
> Steve,
>
> Re the trigger approach - I have tried the "start after previous" and
> that will cause soem words to move into the "correct" places.
>
> But, is it possible to use a trigger so that the words only start to
> move when the user decides that they should?
>
>
> Cheers
>
> Geoff
>
>
>>
>>> I guess this removes too much user control in that it is part of our
>>> approach to get a student to work out an answer before having the
>>> correct answers appear using the mouse or the enter key.
>>>
>>> How much simpler to have a less rude end slide!
>>
>>How much I agree!
>>
>>>
>>> Cheers
>>>
>>> Geoff
>>>
Geoff Cox 10-13-2006, 04:30 PM On Fri, 13 Oct 2006 06:45:33 -0700, "David M. Marcovitz"
<marcoNOSPAM@loyola.edu> wrote:
>Yes, that's what trigger animations are all about, but they only work in
>2002 and above. You can find triggers under the Timing option of the
>animation effects for a particular animation. It will allow a click to
>cause the specified animation to happen only when a particular object is
>clicked.
>--David
David,
I have now got that working in that I have inserted a text box and
when this is successively clicked each word moves into its correct
place.
A couple of questions.
Is it possible to click just once and have a series of words move one
after the other?
I have added a forward/next action button to the slide master as an
easy way of getting that button onto each slide but I do not need that
button on the last page as there I should have an EndShow button. I
cannot seem to delete the forward/next button on the last slide - is
this possible?
If not I seem to have to add a forward/next button by hand to each
slide - or use VBA to add one to all slides except the last one ...
Cheers
Geoff
Steve Rindsberg 10-13-2006, 07:31 PM > I have added a forward/next action button to the slide master as an
> easy way of getting that button onto each slide but I do not need that
> button on the last page as there I should have an EndShow button. I
> cannot seem to delete the forward/next button on the last slide - is
> this possible?
Not as such, but you can choose Format, Background and check Omit Background
Graphics.
That'll remove ALL of the b/g graphics, so next, go to the slide master, select
the stuff you DO want and copy/paste it onto your last slide, then send it to
the back.
Bingla or voigo, as they say in the middle of the Chunnel.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Kathy Jacobs 10-15-2006, 05:01 AM RE: Animating several objects off a singe trigger (with apologies if you
already got an answer...)
To do what you want, move the animations for the other boxes under the
triggered animations, then set them to work with previous or after previous.
--
Kathryn Jacobs, Microsoft MVP OneNote and PowerPoint
Author of Kathy Jacobs on PowerPoint - Available now from Holy Macro! Books
Get PowerPoint and OneNote information at www.onppt.com
I believe life is meant to be lived. But:
if we live without making a difference, it makes no difference that we lived
"Geoff Cox" <geoff.cox@remove-this.freeuk.com> wrote in message
news:rtbvi2p2udkhqib9gd67t8lnddoe7gndf3@4ax.com...
> On Fri, 13 Oct 2006 06:45:33 -0700, "David M. Marcovitz"
> <marcoNOSPAM@loyola.edu> wrote:
>
>>Yes, that's what trigger animations are all about, but they only work in
>>2002 and above. You can find triggers under the Timing option of the
>>animation effects for a particular animation. It will allow a click to
>>cause the specified animation to happen only when a particular object is
>>clicked.
>>--David
>
> David,
>
> I have now got that working in that I have inserted a text box and
> when this is successively clicked each word moves into its correct
> place.
>
> A couple of questions.
>
> Is it possible to click just once and have a series of words move one
> after the other?
>
> I have added a forward/next action button to the slide master as an
> easy way of getting that button onto each slide but I do not need that
> button on the last page as there I should have an EndShow button. I
> cannot seem to delete the forward/next button on the last slide - is
> this possible?
>
> If not I seem to have to add a forward/next button by hand to each
> slide - or use VBA to add one to all slides except the last one ...
>
> Cheers
>
> Geoff
>
David M. Marcovitz 10-16-2006, 04:08 PM I think Steve and Kathy have answered your questions. If not, ask some
more. I was away giving a workshop about using VBA with PowerPoint so I
couldn't respond sooner.
--David
--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Geoff Cox <geoff.cox@remove-this.freeuk.com> wrote in
news:rtbvi2p2udkhqib9gd67t8lnddoe7gndf3@4ax.com:
> On Fri, 13 Oct 2006 06:45:33 -0700, "David M. Marcovitz"
> <marcoNOSPAM@loyola.edu> wrote:
>
>>Yes, that's what trigger animations are all about, but they only work
in
>>2002 and above. You can find triggers under the Timing option of the
>>animation effects for a particular animation. It will allow a click to
>>cause the specified animation to happen only when a particular object
is
>>clicked.
>>--David
>
> David,
>
> I have now got that working in that I have inserted a text box and
> when this is successively clicked each word moves into its correct
> place.
>
> A couple of questions.
>
> Is it possible to click just once and have a series of words move one
> after the other?
>
> I have added a forward/next action button to the slide master as an
> easy way of getting that button onto each slide but I do not need that
> button on the last page as there I should have an EndShow button. I
> cannot seem to delete the forward/next button on the last slide - is
> this possible?
>
> If not I seem to have to add a forward/next button by hand to each
> slide - or use VBA to add one to all slides except the last one ...
>
> Cheers
>
> Geoff
>
|
|
|