如何运行宏“OnEnterSlide"或“OnLeaveSlide"在 Powerpoint VBA 中? [英] How to run a macro "OnEnterSlide" or "OnLeaveSlide" in Powerpoint VBA?

查看:85
本文介绍了如何运行宏“OnEnterSlide"或“OnLeaveSlide"在 Powerpoint VBA 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有某种事件允许在任何时候进入幻灯片或离开幻灯片时运行宏?

Is there some kind of event which allows to run a macro any time one enters a slide or leave a slide ?

推荐答案

SlideShowNextSlide 或 OnSlideShowPageChange

SlideShowNextSlide or OnSlideShowPageChange

您可以在 http://officeone.mvps.org/vba/找到完整列表events_version.html

来自 http://msdn 的代码示例.microsoft.com/en-us/library/aa211571%28office.11​​%29.aspx

此示例确定幻灯片的幻灯片位置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

这篇关于如何运行宏“OnEnterSlide"或“OnLeaveSlide"在 Powerpoint VBA 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆