Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Sub SaveAllOpenDocsAsPDF()
  2. Set fs = CreateObject("Scripting.FileSystemObject")
  3. locFolder = InputBox("Enter the folder path to DOCs", "File Conversion", "C:\myDocs")
  4. Set oFolder = fs.GetFolder(locFolder)
  5. For Each oFile In oFolder.Files
  6. Set aDocument = Application.Documents.Open(oFile.Path)
  7. aDocument.SaveAs FileName:=aDocument.FullName & ".pdf", FileFormat:=wdFormatPDF
  8. aDocument.Close SaveChanges:=wdDoNotSaveChanges
  9. Next oFile
  10. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement