Bom dia!!
Veja se ajuda....
Código: Selecionar todosSub ConvertWordsToPdfs()
'Fonte: http://sebnilsson.com/blog/microsoft-word-macro-convert-word-files-to-pdf-files/
'Talvez seja necessário referenciar a biblioteca Microsoft Word 15.0 Object Library
Dim directory As String
directory = "C:\SeuDiretorioDeArquivosDo_WORD"
Dim fso, newFile, folder, files
Set fso = CreateObject("Scripting.FileSystemObject") '
Set folder = fso.GetFolder(directory)
Set files = folder.files
For Each file In files
Dim newName As String
newName = Replace(file.Path, ".doc", ".pdf")
Documents.Open FileName:=file.Path, _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:=""
ActiveDocument.ExportAsFixedFormat OutputFileName:=newName, _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, 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
Next
End Sub
Att
Espero ter Ajudado.
Se a mensagem foi util Favor
Clicar na mãozinha.
Quando necessário, lembre se de marcar o tópico como
[RESOLVIDO].
Tenha um bom dia
