Sub ppttopdf(control As IRibbonControl) Dim path As String path = "D:\power" Save_PowerPoint_Slide_as_Images path MsgBox "Exported into D:\power" End Sub Sub Save_PowerPoint_Slide_as_Images(path As String) Dim sImagePath As String Dim sImageName As String Dim sPrefix As String Dim oSlide As Slide '* Slide Object Dim lScaleWidth As Long '* Scale Width Dim lScaleHeight As Long '* Scale Height On Error GoTo Err_ImageSave sImagePath = path sPrefix = Split(ActivePresentation.Name, ".")(0) For Each oSlide In ActivePresentation.Slides sImageName = sPrefix & "-" & oSlide.SlideIndex & ".pdf" oSlide.Export sImagePath & "\" & sImageName, "PDF" Next oSlide Err_ImageSave: If Err <> 0 Then MsgBox Err.Description End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)