Merging pdf files in Access

ntech21

New member
Local time
Today, 08:42
Joined
Oct 8, 2014
Messages
2
Hi everyone,

First off, I'm fairly new to Access and brand new to this forum, so please be gentle :)

I'm trying to write a simple little database. At one point on a form, I'm trying to merge all the pdf files in a particular folder.
(I'm using the pdftke.exe program and there will be multiple pdf files)

It all works perfectly if I call it as below, with the actual paths already hard coded. It combines all the pdf files and renames it to the "merged filename.pdf" correctly



Dim stAppName1 As String

stAppName1 = "C:\a folder name\pdftk.exe C:\another folder name\prints\*.pdf cat output C:\folder where merged file will be\merged filename.pdf"
Call Shell(stAppName1, 1)


However, I'm trying to have it work with the middle portion (the folder where all the pdf files are) being created on the fly so to speak.
The middle portion/path I have stored from a previous form and it's stored in a table.

So I'm trying the below, but doesn't seem to work.

Dim stAppName1 As String
Dim combine_files As String

combine_files = (this pulls a path from a stored field on the open form) + "\" + CStr("*.pdf")

stAppName1 = "C:\a folder name\pdftk.exe (combine_files) cat output C:\folder where merged file will be\merged filename.pdf"
Call Shell(stAppName1, 1)


With the code above, it doesn't seem to do anything.

Hopefully I've tried to explain clearly and someone will be able to help.

Thank you
Daryl
 
Try this:
stAppName1 = "C:\a folder name\pdftk.exe " & combine_files & " cat output C:\folder where merged file will be\merged filename.pdf"
 
Hi..

Thanks, I just tried as you suggested, but I got an error when trying to run it saying, "file not found".??
I know there were pdf files in the folders,
 

Users who are viewing this thread

Back
Top Bottom