I would really appreciate any help with this.
Hans
Zurich, Switzerland
I have a query in an Access 2002 database named: "files" with the following fields:
- "fileinfo" (contains file names and locations: (eg. c:\file1.pdf"
- "id" (contains a number)
Question: How can I get the data from the "fileinfo" field of my query into the code? Note that depending on the number of records in my query the number of files being sent to the VBA code for merging will vary!
Here is the code:
Public Function merge(strfilename3 As String)
Dim objMerge As MergePDFClass
Dim arrMerge() As String
Set objMerge = New MergePDFClass 'instantiate the class
ReDim arrMerge(4) 'zero base array, 0 and 1 are the elements
arrMerge(0) = c:\file1.pdf
arrMerge(1) = c:\file2.pdf
arrMerge(2) = c:\file3.pdf
arrMerge(3) = c:\file4.pdf
arrMerge(4) = c:\file5.pdf
With objMerge
.DeleteOriginals = False
.ShowMessages = 1
.MergePDFs strfilename3, arrMerge()
End With
Set objMerge = Nothing
End Function
Hans
Zurich, Switzerland
I have a query in an Access 2002 database named: "files" with the following fields:
- "fileinfo" (contains file names and locations: (eg. c:\file1.pdf"
- "id" (contains a number)
Question: How can I get the data from the "fileinfo" field of my query into the code? Note that depending on the number of records in my query the number of files being sent to the VBA code for merging will vary!
Here is the code:
Public Function merge(strfilename3 As String)
Dim objMerge As MergePDFClass
Dim arrMerge() As String
Set objMerge = New MergePDFClass 'instantiate the class
ReDim arrMerge(4) 'zero base array, 0 and 1 are the elements
arrMerge(0) = c:\file1.pdf
arrMerge(1) = c:\file2.pdf
arrMerge(2) = c:\file3.pdf
arrMerge(3) = c:\file4.pdf
arrMerge(4) = c:\file5.pdf
With objMerge
.DeleteOriginals = False
.ShowMessages = 1
.MergePDFs strfilename3, arrMerge()
End With
Set objMerge = Nothing
End Function