且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将每张Powerpoint幻灯片导出为单独的pdf文件

更新时间:2023-02-13 23:34:33

您可以这样做: 下面的代码将创建PDF,并在当前文件夹末尾添加幻灯片编号和文件名。

Sub ExportSlidesToIndividualPDF()
Dim oPPT As Presentation, oSlide As Slide
Dim sPath As String, sExt As String

Set oPPT = ActivePresentation
sPath = oPPT.FullName & "_Slide_"
sExt = ".pdf"

For Each oSlide In oPPT.Slides
    i = oSlide.SlideNumber
    oSlide.Select
    oPPT.ExportAsFixedFormat _
        Path:=sPath & i & sExt, _
        FixedFormatType:=ppFixedFormatTypePDF, _
        RangeType:=ppPrintSelection
Next
Set oPPT = Nothing
End Sub