I listed the Source folder directory in the Column A of an Excel file, and list the pdf file name in Column B.
I want to use the VBA to go through each row, and batch convert each folder to one pdf.
I am able to use the following script to convert if the "path" is pointing to one tif file.(like c:\temp\test.tif) I couldn't figure out how to change the script to convert the entire folder to one pdf.
Code: Select all
Sub ConvertPdf()
Dim r As Integer
For r = 1 To 2
Dim Path As String
Dim pdfname As String
Path = ActiveSheet.Cells(r, 1).Value
pdfname = ActiveSheet.Cells(r, 2).Value
Set img = CreateObject("ImageMagickObject.MagickImage.1")
img.Convert Path, pdfname
Next r
End Sub