Consulting

Results 1 to 6 of 6

Thread: Export Single Slide as PDF (Current Slide)

  1. #1

    Export Single Slide as PDF (Current Slide)

    Hi,

    Is it possible to export the current side as a PDF.

    Example, I have a certificate at the end of a PPT that I would like to save as PDF once the training is completed.
    I can export the whole show, but not a single slide.

    I am using the following to export the whole show.

    Public Sub ExportAsFixedFormat_Example()

    ActivePresentation.ExportAsFixedFormat "C:\Profile\Documents\Certificate.pdf", ppFixedFormatTypePDF, ppFixedFormatIntentScreen, msoCTrue, ppPrintHandoutHorizontalFirst, ppPrintOutputBuildSlides, msoFalse, , , , False, False, False, False, False

    End Sub

    Any help would be greatly appreciated.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    See if this does it:

    Sub exportONE()
    Dim PR As PrintRange
    Dim lngLast As Long
    Dim savePath As String
    savePath = Environ("USERPROFILE") & "\Desktop\test.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, _
    Intent:=ppFixedFormatIntentScreen, _
    FrameSlides:=msoTrue, _
    ppRangeType:=ppPrintOutputSlides
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Hi,

    Thanks for the help, but I cant get this to work.

    I have assigned it to a custom action button, the button activates during the slideshow when clicked, but nothing happens.

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Somehow I copied the wrong module with several errors!

    See if this does it.

    Sub exportONE()
        Dim PR As PrintRange
        Dim lngLast As Long
        Dim savePath As String
        savePath = Environ("USERPROFILE") & "\Desktop\test2.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, _
        RangeType:=ppPrintSlideRange
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    Excellent.

    Thanks for your help.

  6. #6
    John, thanks for all of your help so far.

    How can I change the save location to the same location as where the PPT file is located.

    Thanks again.

    Sorry about that I have worked it out..

    savePath = ActivePresentation.Path & "\" & "Module 1 Certificate" & ".pdf"

    Thanks
    Last edited by Brightspark9; 01-19-2016 at 01:26 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
  •