Results 1 to 1 of 1

Thread: PP slides exported to PDF

  1. #1

    PP slides exported to PDF


    need a bit help with code. I have found it from various places, and made some changes on it.

    So, it's working well at the moment, but I have a problem with printing range. I would like to add another print range there, fe. Set PR = .Ranges.Add(Start:=2, End:=2), so it would also print slide 2. But at the moment it only prints last page.

    any help with this one, thanks!

    Sub PDF()
    'This function saves the last slide as a PDF file with a time stamp and the users name who completed the induction.
    timestamp = Now()
    Dim PR As PrintRange
    Dim lngLast As Long
    Dim lngFirst As Long
    Dim savePath As String
    Dim PrintPDF As Integer
    Dim name As String
    name = ActivePresentation.Slides(2).Shapes("TextBox1").OLEFormat.object.Text
    'Location of saved file
    savePath = "C:\Powerpoint" & Format(timestamp, "yyyymmdd-hhnn") & " - " & name & ".pdf"
    lngLast = ActivePresentation.Slides.Count
    With ActivePresentation.PrintOptions
        .Ranges.ClearAll ' always do this
        Set PR = .Ranges.Add(Start:=lngLast, End:=lngLast)
    End With
    ActivePresentation.ExportAsFixedFormat _
    Path:=savePath, _
    FixedFormatType:=ppFixedFormatTypePDF, _
    PrintRange:=PR, _
    Intent:=ppFixedFormatIntentScreen, _
    FrameSlides:=msoTrue, _
    End sub
    Last edited by Paul_Hossler; 12-22-2020 at 11:39 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts