VBA/Excel/Access/Word/PowerPoint/Slide Show — различия между версиями

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

Текущая версия на 12:46, 26 мая 2010

Deleting a Custom Show

 
Sub del()
    ActivePresentation.SlideShowSettings.NamedSlideShows("Overview").Delete
End Sub



Exiting the Slide Show

 
Sub view()
    ActivePresentation.SlideShowWindow.View.Exit
End Sub



Moving from Slide to Slide

 
Sub current()
    MsgBox ActivePresentation.SlideShowWindow.View.CurrentShowPosition
End Sub



Pausing the Show and Using White and Black Screens

 
Sub show()
    ActivePresentation.SlideShowWindow.View.State = ppSlideShowBlackScreen
    ActivePresentation.SlideShowWindow.View.State = ppSlideShowWhiteScreen
End Sub



ppShowTypeKiosk

 
Sub show()
  With ActivePresentation.SlideShowSettings
    .LoopUntilStopped = msoCTrue
    .AdvanceMode = ppSlideShowUseSlideTimings
    .ShowType = ppShowTypeKiosk
    .Run
   End With
End Sub



ppShowTypeSpeaker

 
Sub show()
  With ActivePresentation.SlideShowSettings
    .LoopUntilStopped = msoCTrue
    .AdvanceMode = ppSlideShowUseSlideTimings
    .ShowType = ppShowTypeSpeaker
    .Run
   End With
End Sub



ppShowTypeWindow

 
Sub show()
  With ActivePresentation.SlideShowSettings
    .LoopUntilStopped = msoCTrue
    .AdvanceMode = ppSlideShowUseSlideTimings
    .ShowType = ppShowTypeWindow
    .Run
   End With
End Sub



Show slides 4 through 8 in the presentation

 
Sub settings()
    With Presentations("Corporate.ppt").SlideShowSettings
        .RangeType = ppShowSlideRange
        .StartingSlide = 4
        .EndingSlide = 8
        .Run
    End With
End Sub



Starting and Stopping Custom Shows

 
Sub goto()
    SlideShowWindows(1).GotoNamedShow SlideShowName:="New Show"
End Sub



Starting a Slide Show

 
Sub run()
    ActivePresentation.SlideShowSettings.Run
End Sub



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.

 
Sub gotoSlide()
    Application.SlideShowWindows(1).View.GotoSlide Index:=5
End Sub



To display the first slide in the presentation, use the First method.

 
Sub first()
    ActivePresentation.SlideShowWindow.View.First
End Sub



To display the last slide, use the Last method:

 
Sub last()
    ActivePresentation.SlideShowWindow.View.Last
End Sub



To display the next slide, use the Next method.

 
Sub next()
    ActivePresentation.SlideShowWindow.View.Next
End Sub



To display the previous slide, use the Previous method.

 
Sub viewNext()
    ActivePresentation.SlideShowWindow.View.Next
End Sub



To exit a custom show, use the EndNamedShow method and then use the Next method to advance the presentation.

 
Sub show()
    With ActivePresentation.SlideShowWindow.View
        .EndNamedShow
        .Next
    End With
End Sub



To start running a custom show

 
Sub slide()
    With ActivePresentation.SlideShowSettings
        .RangeType = ppShowNamedSlideShow
        .SlideShowName = "Short Show"
        .Run
    End With
End Sub