PDA

View Full Version : Export Single Slide as PDF (Current Slide)



Brightspark9
01-14-2016, 07:46 AM
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.

John Wilson
01-15-2016, 01:46 PM
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

Brightspark9
01-16-2016, 01:50 AM
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.

John Wilson
01-16-2016, 10:27 AM
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

Brightspark9
01-16-2016, 11:39 PM
Excellent.

Thanks for your help.:hi:

Brightspark9
01-19-2016, 01:09 AM
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