VBA/Excel/Access/Word/PowerPoint/Slide Show
Содержание
- 1 Deleting a Custom Show
- 2 Exiting the Slide Show
- 3 Moving from Slide to Slide
- 4 Pausing the Show and Using White and Black Screens
- 5 ppShowTypeKiosk
- 6 ppShowTypeSpeaker
- 7 ppShowTypeWindow
- 8 Show slides 4 through 8 in the presentation
- 9 Starting and Stopping Custom Shows
- 10 Starting a Slide Show
- 11 To display a particular slide in the slide show, use the GotoSlide method of the View object, using the Index argument to specify the slide number.
- 12 To display the first slide in the presentation, use the First method.
- 13 To display the last slide, use the Last method:
- 14 To display the next slide, use the Next method.
- 15 To display the previous slide, use the Previous method.
- 16 To exit a custom show, use the EndNamedShow method and then use the Next method to advance the presentation.
- 17 To start running a custom show
Deleting a Custom Show
<source lang="vb">
Sub del()
ActivePresentation.SlideShowSettings.NamedSlideShows("Overview").Delete
End Sub
</source>
Exiting the Slide Show
<source lang="vb">
Sub view()
ActivePresentation.SlideShowWindow.View.Exit
End Sub
</source>
Moving from Slide to Slide
<source lang="vb">
Sub current()
MsgBox ActivePresentation.SlideShowWindow.View.CurrentShowPosition
End Sub
</source>
Pausing the Show and Using White and Black Screens
<source lang="vb">
Sub show()
ActivePresentation.SlideShowWindow.View.State = ppSlideShowBlackScreen ActivePresentation.SlideShowWindow.View.State = ppSlideShowWhiteScreen
End Sub
</source>
ppShowTypeKiosk
<source lang="vb">
Sub show()
With ActivePresentation.SlideShowSettings .LoopUntilStopped = msoCTrue .AdvanceMode = ppSlideShowUseSlideTimings .ShowType = ppShowTypeKiosk .Run End With
End Sub
</source>
ppShowTypeSpeaker
<source lang="vb">
Sub show()
With ActivePresentation.SlideShowSettings .LoopUntilStopped = msoCTrue .AdvanceMode = ppSlideShowUseSlideTimings .ShowType = ppShowTypeSpeaker .Run End With
End Sub
</source>
ppShowTypeWindow
<source lang="vb">
Sub show()
With ActivePresentation.SlideShowSettings .LoopUntilStopped = msoCTrue .AdvanceMode = ppSlideShowUseSlideTimings .ShowType = ppShowTypeWindow .Run End With
End Sub
</source>
Show slides 4 through 8 in the presentation
<source lang="vb">
Sub settings()
With Presentations("Corporate.ppt").SlideShowSettings .RangeType = ppShowSlideRange .StartingSlide = 4 .EndingSlide = 8 .Run End With
End Sub
</source>
Starting and Stopping Custom Shows
<source lang="vb">
Sub goto()
SlideShowWindows(1).GotoNamedShow SlideShowName:="New Show"
End Sub
</source>
Starting a Slide Show
<source lang="vb">
Sub run()
ActivePresentation.SlideShowSettings.Run
End Sub
</source>
To display a particular slide in the slide show, use the GotoSlide method of the View object, using the Index argument to specify the slide number.
<source lang="vb">
Sub gotoSlide()
Application.SlideShowWindows(1).View.GotoSlide Index:=5
End Sub
</source>
To display the first slide in the presentation, use the First method.
<source lang="vb">
Sub first()
ActivePresentation.SlideShowWindow.View.First
End Sub
</source>
To display the last slide, use the Last method:
<source lang="vb">
Sub last()
ActivePresentation.SlideShowWindow.View.Last
End Sub
</source>
To display the next slide, use the Next method.
<source lang="vb">
Sub next()
ActivePresentation.SlideShowWindow.View.Next
End Sub
</source>
To display the previous slide, use the Previous method.
<source lang="vb">
Sub viewNext()
ActivePresentation.SlideShowWindow.View.Next
End Sub
</source>
To exit a custom show, use the EndNamedShow method and then use the Next method to advance the presentation.
<source lang="vb">
Sub show()
With ActivePresentation.SlideShowWindow.View .EndNamedShow .Next End With
End Sub
</source>
To start running a custom show
<source lang="vb">
Sub slide()
With ActivePresentation.SlideShowSettings .RangeType = ppShowNamedSlideShow .SlideShowName = "Short Show" .Run End With
End Sub
</source>