Skip to content

Instantly share code, notes, and snippets.

@kebien6020
Last active April 25, 2018 14:04
Show Gist options
  • Save kebien6020/08bc7d8ae3f8d04ccfaa27f690570331 to your computer and use it in GitHub Desktop.
Save kebien6020/08bc7d8ae3f8d04ccfaa27f690570331 to your computer and use it in GitHub Desktop.
Word vba macro to instantly export as pdf in the same folder
Sub ExportAsPDF()
'Instantly export as pdf in the same folder
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
Replace(Replace(ActiveDocument.FullName, ".docx", ".pdf"), ".doc", ".pdf"), _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, Item:= _
wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment