有时候我们希望通过vba直接控制ppt进入幻灯片放映模式。
在ppt vba中,可以使用SlideShowSettings对象的Run方法运行幻灯片的放映。
以下vba代码直接将当前ppt切换进入幻灯片放映模式:
Sub QQ1722187970()
Dim oPresentation As PowerPoint.Presentation
Set oPresentation = PowerPoint.ActivePresentation
Dim oSlide As Slide
Dim oSST As PowerPoint.SlideShowTransition
Dim oSSS As SlideShowSettings
With oPresentation
Set oSSS = .SlideShowSettings
With oSSS
.Run
End With
End With
End Sub


发表评论