PowerPoint Programming: SlideShow issue.

G

Guest

I am into PowerPoint Automation.

Before I explain my problem I would like to describe a PowerPoint's
behaviour since my problem is related to it. Suppose you created a
presentation with 10 slides. You select slide no. 4 and click on the symbol
for "SlideShow (from current slide)". The slideshow will start from Slide
No.4. Now suppose you hit backspace during slideshow it will take you to
slide no.3. Subsequent backspaces will take you to previous animated items on
previous slides untill you reach slide 1.

Here is my problem:
I need to programmatically start the slideshow from the currently selected
slide. So, what I did is I first found which slide is selected. After that I
wrote the following code to start the slideshow from the currently selected
slide:

With App_.ActivePresentation.SlideShowSettings
.ShowType = ppShowTypeSpeaker
.LoopUntilStopped = msoFalse
.ShowWithNarration = msoTrue
.ShowWithAnimation = msoTrue
If .RangeType = ppShowSlideRange Then
.StartingSlide = .StartingSlide
.EndingSlide = .EndingSlide
ElseIf .RangeType = ppShowAll Then
.RangeType = ppShowSlideRange
.StartingSlide = firstselectedslide
.EndingSlide = App_.ActivePresentation.Slides.Count
End If

.AdvanceMode = ppSlideShowUseSlideTimings
.PointerColor.RGB = RGB(Red:=255, Green:=0, Blue:=0)
.Run
End With


I have put this check: "If .RangeType = ppShowSlideRange Then" for the case
where the user has explicitly set the Start and End slide using the
"SlideShow->Set Up Show" menu item. But lets forget this part for now.

So now the user selects a slide and clicks my "custom button" to start the
slideshow. Now, I have to first check the selected slide. Then change the
RangeType to ppShowSlideRange and then only I can show the slideshow from the
selected slide. But, the problem is if I hit backpsace during slideshow it
won't go to the previous slide (previous to the selected slide). I guess this
is becoz RangeType=ppShowSlideRange. But, if I don't do
RangeType=ppShowSlideRange then I cannot start the slideshow from the
currently selected slide programmatically.

This might be a bit confusing but I hope you have understood my problem. Is
there any way I can programmatically start the slideshow from the currently
selected slide and also enable going back to previous slides during the
slideshow when user hits backspace (or back arrow) ?

Please help. Thanks a lot in advance.
 
B

Bill Dilworth

Why not just ...

Sub AVeryGoodPlaceToStart()
Dim SoLaTe As Integer
SoLaTe = Application.Windows(1).Selection _
.SlideRange(1).SlideNumber
ActivePresentation.SlideShowSettings.Run
SlideShowWindows(1).View.GotoSlide SoLaTe
End Sub

When activated, it will take you briefly to the first viewable slide, but
immediately jump to the slide that was selected in edit view. The slides
can be 'backed into' normally (that sounds weird) and the code is a bit
simpler.

--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
M

Michael Koerner

Just a thought that if you were to put a blank slide as your first slide,
and with Bill's macro you would not see the first slide with whatever is on
it. Which would also eliminate any problem of coming back to the first slide
which may contain animations which will not work if you just come back to
that slide you could come back to the blank slide and have your animations
work in the original first slide.

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]


| Why not just ...
|
| Sub AVeryGoodPlaceToStart()
| Dim SoLaTe As Integer
| SoLaTe = Application.Windows(1).Selection _
| .SlideRange(1).SlideNumber
| ActivePresentation.SlideShowSettings.Run
| SlideShowWindows(1).View.GotoSlide SoLaTe
| End Sub
|
| When activated, it will take you briefly to the first viewable slide, but
| immediately jump to the slide that was selected in edit view. The slides
| can be 'backed into' normally (that sounds weird) and the code is a bit
| simpler.
|
| --
| Bill Dilworth
| A proud member of the Microsoft PPT MVP Team
| Users helping fellow users.
| http://billdilworth.mvps.org
| -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
| vestprog2@ Please read the PowerPoint FAQ pages.
| yahoo. They answer most of our questions.
| com www.pptfaq.com
| .
|
|
| | >I am into PowerPoint Automation.
| >
| > Before I explain my problem I would like to describe a PowerPoint's
| > behaviour since my problem is related to it. Suppose you created a
| > presentation with 10 slides. You select slide no. 4 and click on the
| > symbol
| > for "SlideShow (from current slide)". The slideshow will start from
Slide
| > No.4. Now suppose you hit backspace during slideshow it will take you to
| > slide no.3. Subsequent backspaces will take you to previous animated
items
| > on
| > previous slides untill you reach slide 1.
| >
| > Here is my problem:
| > I need to programmatically start the slideshow from the currently
selected
| > slide. So, what I did is I first found which slide is selected. After
that
| > I
| > wrote the following code to start the slideshow from the currently
| > selected
| > slide:
| >
| > With App_.ActivePresentation.SlideShowSettings
| > .ShowType = ppShowTypeSpeaker
| > .LoopUntilStopped = msoFalse
| > .ShowWithNarration = msoTrue
| > .ShowWithAnimation = msoTrue
| > If .RangeType = ppShowSlideRange Then
| > .StartingSlide = .StartingSlide
| > .EndingSlide = .EndingSlide
| > ElseIf .RangeType = ppShowAll Then
| > .RangeType = ppShowSlideRange
| > .StartingSlide = firstselectedslide
| > .EndingSlide = App_.ActivePresentation.Slides.Count
| > End If
| >
| > .AdvanceMode = ppSlideShowUseSlideTimings
| > .PointerColor.RGB = RGB(Red:=255, Green:=0, Blue:=0)
| > .Run
| > End With
| >
| >
| > I have put this check: "If .RangeType = ppShowSlideRange Then" for the
| > case
| > where the user has explicitly set the Start and End slide using the
| > "SlideShow->Set Up Show" menu item. But lets forget this part for now.
| >
| > So now the user selects a slide and clicks my "custom button" to start
the
| > slideshow. Now, I have to first check the selected slide. Then change
the
| > RangeType to ppShowSlideRange and then only I can show the slideshow
from
| > the
| > selected slide. But, the problem is if I hit backpsace during slideshow
it
| > won't go to the previous slide (previous to the selected slide). I guess
| > this
| > is becoz RangeType=ppShowSlideRange. But, if I don't do
| > RangeType=ppShowSlideRange then I cannot start the slideshow from the
| > currently selected slide programmatically.
| >
| > This might be a bit confusing but I hope you have understood my problem.
| > Is
| > there any way I can programmatically start the slideshow from the
| > currently
| > selected slide and also enable going back to previous slides during the
| > slideshow when user hits backspace (or back arrow) ?
| >
| > Please help. Thanks a lot in advance.
|
|
 
G

Guest

At the bottom left of the PowerPoint there are three small buttons: Normal
View, Slide Sorter VIew & Slide Show (rom current slide). How can I access
that button? If I can access that button then I can use the execute method to
programmatically simulate a click on that button.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top