Table of contents
TOC
折叠目录
展开目录

Application.SlideShowNextSlide 事件 (PowerPoint)Application.SlideShowNextSlide Event (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

在过渡到下一张幻灯片之前立即发生。对于第一张幻灯片, SlideShowBegin事件之后立即发生。Occurs immediately before the transition to the next slide. For the first slide, occurs immediately after the SlideShowBegin event.

语法Syntax

表达式SlideShowNextSlide( Wn )expression. SlideShowNextSlide( Wn )

表达式_返回应用程序对象的表达式。_expression An expression that returns a Application object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
WnWn必需RequiredSlideShowWindowSlideShowWindow活动幻灯片放映窗口。The active slide show window.

注解Remarks

有关使用应用程序对象事件的信息,请参阅如何: 使用对象事件的应用程序For information about using events with the Application object, seeHow to: Use Events with the Application Object.

示例Example

本示例确定为SlideShowNextSlide事件后该幻灯片的幻灯片位置。如果下一张幻灯片第三张幻灯片,该示例就会变成一支笔和笔的颜色为红色指针的类型。This example determines the slide position for the slide following the SlideShowNextSlide event. If the next slide is slide three, the example changes the type of pointer to a pen and the pen color to red.

Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)



   Dim Showpos As Integer



   Showpos = Wn.View.CurrentShowPosition + 1

If Showpos = 3 Then  

         With ActivePresentation.SlideShowSettings.Run.View

            .PointerColor.RGB = RGB(255, 0, 0)

            .PointerType = ppSlideShowPointerPen

         End With

      Else

         With ActivePresentation.SlideShowSettings.Run.View

            .PointerColor.RGB = RGB(0, 0, 0)

            .PointerType = ppSlideShowPointerArrow

         End With

      End If

End Sub

本示例将全局计数器变量的值设置为 0。然后计算此事件后幻灯片上的形状个数,确定哪些形状具有动画,并用每个形状的动画顺序和编号填充全局数组。This example sets a global counter variable to zero. Then it calculates the number of shapes on the slide following this event, determines which shapes have animation, and fills a global array with the animation order and the number of each shape.

请注意 在此示例中创建的数组还可在SlideShowNextBuild事件的示例。Note The array created in this example is also used in the SlideShowNextBuild event example.

Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)



   Dim i as Integer, j as Integer, numShapes As Integer

   Dim objSld As Slide



   Set objSld = ActivePresentation.Slides _
        (ActivePresentation.SlideShowWindow.View _
        .CurrentShowPosition + 1)

      With objSld.Shapes

         numShapes = .Count

         If numShapes > 0 Then

            j = 1

            ReDim shpAnimArray(1 To 2, 1 To numShapes)

            For i = 1 To numShapes

               If .Item(i).AnimationSettings.Animate Then

                  shpAnimArray(1, j) = _
                     .Item(i).AnimationSettings.AnimationOrder

                     shpAnimArray(2, j) = i

                     j = j + 1

               End If

            Next

         End If

      End With

End Sub

另请参阅See also

概念Concepts

Application 对象Application Object

© 2018 Microsoft