I am trying to use a shell command to dig into a specified directory (and ideally all sub-directories) and open every pdf file and re-save with security settings changed (adding a password to prevent printing).
I can't seem to get the shell command to run from where it is:
Option Explicit Sub OpenPDFFilesAndSave() 'opens every pdf file in a directory Dim FSO As Object, Fld As Object, Fil As Object Dim MainFolderName As String, i As Integer Dim RetVal As Variant Set FSO = CreateObject("Scripting.FileSystemObject") MainFolderName = "C:\Test" Set Fld = FSO.GetFolder(MainFolderName) For Each Fil In Fld.Files i = i + 1 RetVal = Shell("C:\Program Files\Adobe\Acrobat 7.0 _&\Acrobat\Acrobat.exe MainFolderName & " \ " & Fil.Name") Next 'have to add save the file, and change the print settings but not figured that out yet End Sub
Any help would be much appreciated!
Thanks in advance,