Brightspark9
02-03-2016, 03:19 AM
Hi,
I have code that prints the current page as a PDF file.
Can anyone help and show how to run the code as soon as the slide is displayed without having to click buttons.
Thanks for any help.
Sub exportONE()
Dim PR As PrintRange
Dim lngLast As Long
Dim savePath As String
savePath = ActivePresentation.Path & "\" & "Certificate" & ".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
With Application
For Each w In .Presentations
w.Save
Next w
.Quit
End With
End Sub
I have code that prints the current page as a PDF file.
Can anyone help and show how to run the code as soon as the slide is displayed without having to click buttons.
Thanks for any help.
Sub exportONE()
Dim PR As PrintRange
Dim lngLast As Long
Dim savePath As String
savePath = ActivePresentation.Path & "\" & "Certificate" & ".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
With Application
For Each w In .Presentations
w.Save
Next w
.Quit
End With
End Sub