PDA

View Full Version : VBA Help with PowerPoint Custom Show



blescohier
06-07-2010, 12:34 PM
Hi,

We have a slideshow that contains a custom show. The custom show is set to "Show and Return" so that when it is over the entire presentation does not exit. We want to be able to exit the custom show by clicking a link, and have the presentation go to a linked slide, not necessarily the slide from which the custom show was invoked.

So far we have a macro that detects if it has been called from a custom show, and if so, sends an "esc" to end the custom show. Else it navigates to the proper slide:

Sub exitCustomShow()

With SlideShowWindows(1).View
If .IsNamedShow Then
SendKeys("{ESC}")

Else
navToSlide '(a macro defined elsewhere, it works)
End If

End With

I can't figure out how to also run navToSlide following the call to SendKeys - it seems that sending the escape character terminates the macro..?

How can we both exit the custom show AND navigate to a different slide?

Thanks!

-Bill

Cosmo
06-07-2010, 12:54 PM
Sub exitCustomShow()
With SlideShowWindows(1).View
If .IsNamedShow Then
.Exit
Else
navToSlide '(a macro defined elsewhere, it works)
End If
End With
End Sub

blescohier
06-07-2010, 01:15 PM
Thanks - that led me to .EndNamedShow, which (so far) seems to be allowing the subsequent navigation we need...

Thanks again,

-Bill

Cosmo
06-07-2010, 01:22 PM
Thanks - that led me to .EndNamedShow, which (so far) seems to be allowing the subsequent navigation we need...

Thanks again,

-Bill
Be aware that using .EndNamedShow has different results than using .Exit.

From the EndNamedShow description:

Switches from running a custom, or named, slide show to running the entire presentation of which the custom show is a subset. When the slide show advances from the current slide, the next slide displayed will be the next one in the entire presentation, not the next one in the custom slide show.

Whereas, using .Exit does the same as when you hit the 'Escape' key in the presentation - it exits the current show and returns where you started. If you linked to the current custom show from another custom show, you will return to the previous show via .Exit. I believe that using .EndNamedShow will place you into the entire presentation.