1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub 批量() 名称 = Dir("C:\孙兴华\") Do While 名称 <> "" Set 文档 = Word.Application.Documents.Open("C:\孙兴华\" & 名称) 路径 = 文档.Path 文档.ExportAsFixedFormat OutputFileName:=(路径 & "\" & 文档.Name & ".pdf"), _ ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _ wdExportOptimizeForPrint, Range:=wdExportFromTo, From:=1, To:=文档.Range.Information(wdNumberOfPagesInDocument), _ Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _ CreateBookmarks:=wdExportCreateHeadingBookmarks, DocStructureTags:=True, _ BitmapMissingFonts:=True 文档.Save 文档.Close 名称 = Dir Loop End Sub
|