楼主 罗刚君 |
Sub 批量将WORD文件转成PDF() Dim str As String, n As Long, fd, Nam As String On Error GoTo err Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd If .Show = -1 Then t = .SelectedItems(1) Else Exit Sub End With Application.ScreenUpdating = False str = Dir(t & "\*.doc*") While Len(str) > 0 n = n + 1 Documents.Open FileName:=t & IIf(Right(t, 1) = "\", "", "\") & str, ConfirmConversions:=False, ReadOnly:= _ False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _ "", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _ Format:=wdOpenFormatAuto, XMLTransform:="" Nam = CreateObject("Scripting.FileSystemObject").getextensionname(str) ActiveDocument.ExportAsFixedFormat OutputFileName:=(t & IIf(Right(t, 1) = "\", "", "\") & Replace(str, Nam, "pdf")), _ ExportFormat:=wdExportFormatPDF, OpenAfterExport:=True, OptimizeFor:= _ wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _ Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _ CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _ BitmapMissingFonts:=True, UseISO19005_1:=False ActiveDocument.Close False str = Dir() Wend Application.ScreenUpdating = True err: End Sub WORD 2007专用 |
2楼 yd0209 |
能否将PDF转为WORD呢? |