VBA/Excel/Access/Word/PowerPoint/Slide Show

Материал из VB Эксперт
Перейти к: навигация, поиск

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>