要用vba将某个幻灯片导出为图片,需要用到Slide.Export方法。
代码如下:
Sub QQ1722187970()
Set oWShell = CreateObject(“WScript.Shell”)
With oWShell
‘获取桌面文件夹的路径
sDesktopPath = .SpecialFolders(“Desktop”)
End With
Dim oPPT As PowerPoint.Presentation
Set oPPT = PowerPoint.ActivePresentation
Dim oSlide As Slide
Set oSlide = oPPT.Windows(1).View.Slide
oSlide.Export sDesktopPath & “\test.png”, “png”
End Sub
发表评论