Question: How can powerpoint print to pdf using VBA?
I'm trying to get PowerPoint to print to pdf. I keep getting errors.
This is the error that is thrown....

I've been using this as a reference document: https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.exportasfixedformat
Code: Select all
#NoEnv
SendMode Input
#SingleInstance Force
;####
; NOTE: You must open PowerPoint first.
;####
OutputFile := "C:\test.pdf" ; save location.
ppt := ComObjActive("Powerpoint.Application")
ppt.ActivePresentation.ExportAsFixedFormat( OutputFile, ppFixedFormatTypePDF, ppFixedFormatIntentScreen, msoCTrue, ppPrintHandoutHorizontalFirst, ppPrintOutputBuildSlides, msoFalse, , , , False, False, False, False, False)
return
Thank you.