Consulting

Results 1 to 3 of 3

Thread: How to Show and Return a Custom Show in VBA?

  1. #1

    How to Show and Return a Custom Show in VBA?

    Hello,

    I've been working on this project where I've found using a custom show helps avoid slides' animations resetting themselves upon return. With that said, I'm looking for a way to create a subroutine where I would open up a custom show with the "Show and Return" setting so that when my other subroutine closes out of the slideshow, it should return to the previous slide viewed instead of closing out entirely.

    Here's a snippet of what I found online:
    Sub slide()
        With ActivePresentation.SlideShowSettings
            .RangeType = ppShowNamedSlideShow
            .SlideShowName = "TestCustomShow"
            .Run
        End With
    End Sub
    Problem with this one is, it doesn't do the show and return. It also changes the settings to ONLY play the custom show. This could be fixed with having
    .RangeType = ppShowAll
    in the subroutine to close the slideshow, but still doesn't show and return.

    Here is one code I discovered to work better than what I found above:
    ActivePresentation.SlideShowSettings.Application.SlideShowWindows(1).View.GotoNamedShow ("TestCustomShow")
    Still no luck finding how to "Show And Return."

    The reason why I'd rather have the show custom slideshow as a macro and instead of an active link to the custom slideshow is I'd like to also run some code before to affect the current slide before I enter the custom slideshow. Any suggestions on how to run a function and open a custom slideshow (with show and return) on one click of a button?

  2. #2
    Ok, I found this code to work well with the show and return. Unfortunately, calling out the function isn't working at all. The function is basically turn these certain shapes visibility on the current slide, and does work well on it's own.

    Sub StartCustomSlideShow(oshp As Shape)
     Call TestFunction
     
     With oshp.ActionSettings(1)
            .Action = ppActionNamedSlideShow
            .SlideShowName = "TestCustomShow"
            .ShowAndReturn = True
            .Run
     End With

  3. #3
    Nevermind, I got it solved now. A simple restart of the laptop and re-positioning the "Call TestFunction" to the exit slideshow macro in the proper spot did the trick.

Posting Permissions

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