Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run code in Slide Show mode (PP2000 WXP)

    I cannot get macros to run in Slide Show mode.
    I record a simple macro to draw a box. I then put an Action button on the screen and associate it with the macro using Slide Show/Action Setting/Run macro. I also add a sound to play.
    The sound works but the macro will not run.
    I have macros enabled (low).
    Funny enough, the following runs. I get the msgbox but macro4 does not run.
    Can anyone help?
    Des
    Sub Macro2()
    MsgBox "macro 2 running"
    With ActivePresentation.Slides(1).Shapes("AutoShape 5").ActionSettings(ppMouseOver)
    .Action = ppActionRunMacro
    .Run = "Macro4"
    .AnimateAction = True
    End With
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run code in Slide Show mode (PP2000 WXP)

    Welcome to Woody's Lounge!

    The code looks ok.

    Make sure that the box is really named 'AutoShape 5'. If you use a non-existing name, the code will fail without displaying an error message.

  3. #3
    New Lounger
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run code in Slide Show mode (PP2000 WXP)

    Thanks Hans but no luck.
    It works fine in Normal view but not in Slide Show.
    The following works fine (another try) except that the shape does not move (ie, the message box comes up).
    Bear in mind that it is the first time I have tried to run a macro in PP (I'm OK in Excel).
    Des

    Sub Macro6()
    MsgBox "first line"
    ActiveWindow.Selection.SlideRange.Shapes("AutoShap e 5").IncrementLeft 40#
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run code in Slide Show mode (PP2000 WXP)

    Selection doesn't work in slideshow view. If the slide is the 3rd in the presentation, try

    ActivePresentation.Slides(3).Shapes("AutoShape 5").IncrementLeft 40#

    or

    ActivePresentation.Slides(3).Shapes(5).IncrementLe ft 40#

    It is probably possible to refer to the shape in another way if you are creating it in the macro itself, but we'd need to know more about the code for that.

  5. #5
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Run code in Slide Show mode (PP2000 WXP)

    You cannot have selections in slide show view so any code including .selection will fail.

    Try :

    Sub moveme(oshp As Shape)
    oshp.IncrementLeft 40
    End Sub
    If you are clicking the shape to be moved

    OR

    Sub moveme()
    MsgBox "Does this work?"
    ActivePresentation.SlideShowWindow.View.Slide.Shap es("AutoShape 5").IncrementLeft 40
    End Sub

    If you are clicking a button

  6. #6
    New Lounger
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run code in Slide Show mode (PP2000 WXP)

    John and Hans, thanks ever so much for this. I think I can do what I want now (which is to show a pop up text box on a slide)
    thanks again, Des Murphy

  7. #7
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Run code in Slide Show mode (PP2000 WXP)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •