【发布时间】:2018-10-29 17:59:18
【问题描述】:
目前我正在使用下面的代码将单词 doc 保存到具有默认文件名的 PDF 中。我想更改它以便我可以修改 PDF 文件名。欣赏它!
代码:
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
【问题讨论】:
-
嗨,要更改文件名,请更改任何字符串的“ActiveDocument.FullName”