Last active
October 6, 2023 14:10
-
-
Save kastnerp/361d4cdf68d5843acc93dce40f33209d to your computer and use it in GitHub Desktop.
Export PPTX to PDF | Macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ConvertToPDFHighQuality() | |
Dim pdfFileName As String | |
Dim activePresentationPath As String | |
' Get the full path of the active presentation | |
activePresentationPath = ActivePresentation.FullName | |
' Create a PDF filename based on the original PowerPoint filename | |
pdfFileName = Replace(activePresentationPath, ".pptx", "_HighQuality.pdf") ' Make sure to replace .pptx with .pptm if macro is saved with presentation | |
pdfFileName = Replace(pdfFileName, ".pptm", "_HighQuality.pdf") | |
' Export to PDF with high-quality settings | |
ActivePresentation.ExportAsFixedFormat _ | |
Path:=pdfFileName, _ | |
FixedFormatType:=ppFixedFormatTypePDF, _ | |
Intent:=ppFixedFormatIntentPrint, _ | |
RangeType:=ppPrintAll | |
' Notify the user that the PDF has been created | |
MsgBox "PDF has been created with high-quality settings: " & pdfFileName | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment