aresthegod
08-04-2020, 04:18 AM
I am looking for help as I am not a programmer. I would like to be able to do the following:
to silently pdf the open Word document (no dialogues)
the output file name the same as the input file name
the output folder the same the input folder
automatically overwrite if the pdf file already exists
photographs in the text not downsized below 600 dpi
There is a code (see below) that does all of the above but the last point . It uses "save as" function in MS Word which reduces the dpi of photographs to too low level. For the documents with photographs I need to manually use the "Microsoft print to PDF" which gives decent quality of pictures.
A macro that prints using the "Microsoft print to PDF" meeting all of the criteria above points would be great. Could anybody help ?
Sub Silent_save_to_PDF()
'
' Silent Save_to_PDF Macro
'
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
Replace(ActiveDocument.FullName, ".docx", ".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
to silently pdf the open Word document (no dialogues)
the output file name the same as the input file name
the output folder the same the input folder
automatically overwrite if the pdf file already exists
photographs in the text not downsized below 600 dpi
There is a code (see below) that does all of the above but the last point . It uses "save as" function in MS Word which reduces the dpi of photographs to too low level. For the documents with photographs I need to manually use the "Microsoft print to PDF" which gives decent quality of pictures.
A macro that prints using the "Microsoft print to PDF" meeting all of the criteria above points would be great. Could anybody help ?
Sub Silent_save_to_PDF()
'
' Silent Save_to_PDF Macro
'
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
Replace(ActiveDocument.FullName, ".docx", ".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