Showing posts with label Convert word document to pdf using VBA. Show all posts
Showing posts with label Convert word document to pdf using VBA. Show all posts

Tuesday, July 7, 2020

Convert word document to pdf using VBA

Option Explicit

Sub vba_word_to_pdf()
Dim output_file As String
output_file = ActivePresentation.Path & "\" & Left(ActivePresentation.Name, Len(ActivePresentation.Name) - 5) & ".pdf"

'MsgBox ("hello")
ActivePresentation.ExportAsFixedFormat output_file, ppFixedFormatTypePDF, ppFixedFormatIntentPrint

End Sub