gpt4 book ai didi

vba - 将每张 Powerpoint 幻灯片导出到单独的 pdf 文件

转载 作者:行者123 更新时间:2023-12-05 02:23:57 26 4
gpt4 key购买 nike

我需要为演示文稿的每张幻灯片生成一个 pdf 文件。

我正在使用以下代码:

ActivePresentation.ExportAsFixedFormat ActivePresentation.Path & "\" & ActivePresentation.Name & ".pdf", ppFixedFormatTypePDF, ppFixedFormatIntentPrint

这段代码工作正常,但它会将所有幻灯片导出到一个唯一的 pdf 文件中。

最佳答案

你可以这样做:下面的代码将创建 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

关于vba - 将每张 Powerpoint 幻灯片导出到单独的 pdf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17929124/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com