Thanks, khkremer. I don't know if upgrading is an option. We may have found a workaround in the meantime. Let me try this workaround and I will get back to you.
Thanks,
Alexis
Main Topics
Browse All TopicsHi. I have been playing with this for a while now. I am testing this logic from Access 2003 in XP although we really need this to work in another application in XP that is not very well known (Vee 7.5.)
I am printing an Access report directly to a pdf file. I unchecked the checkbox for "Prompt for Adobe PDF filename" and set the port to save to the folder I want. That is all working. However, the pdffile name is being set each time to the Access report caption (Deposition.pdf). I need to be able to set the filename each time it is printed.
Here's the code I have that works along with the Adobe settings.
stDocName = "rptDeposition"
DoCmd.OpenReport stDocName, acViewPreview, , "SampleID='" & Me.SampleID & "'"
DoCmd.PrintOut
Is there an easy way to tell Adobe what filename I want to use? I hope that figuring it out in Access will help me figure it out in the other application. We have Adobe Acrobat 6.0 Professional and Acrobat Distiller 6.0.
Thanks for your help.
Alexis
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
khkremer.
We can upgrade to Acrobat 9 Professional. If so, how do we change the filename using the registry key? Also, we will have multiple pages to print to one pdf file before we want to change the name. Can we set Acrobat to not create a new pdf each time we do a printscreen and have the ability to tell Adobe when we are done printing to that pdf and to start a new one? I can open a new question for that if you want.
We almost had this process working using pdfFactory but we are running into some inconsistencies and may end up having to use Adobe after all.
Also, I won't be back to this client again until Wed so I can't test anything out until then.
Thanks,
Alexis
Take a look at the Distiller API Reference (http://www.adobe.com/devn
Unfortunately, you can only do this for one job at a time (unless you can send all the pages in the same print operation). So you would need to collect a number of PDF documents, and then when you are done you can use VBA to automate Acrobat to combine all these documents into the one output document.
We are currently testing in Vee only. I am no longer testing in Access. We worked around the filename problem by writing a VBScript program to rename the Vee.pdf file created by the process after the process is done. The Vee application can call a batch file so I created a batch file that calls my VBS program. That works, however, we ran into some timing issues with the VBS trying to change the name even though the pdf has not finished being written yet.
We're not sure if we can write VB code from within Vee. That's why we tried to figure out a solution that would be outside of Vee. If I can change the registry key and combine multiple PDF documents using VBScript, that should work from Vee.
Thanks,
Alexis
OK, in that case it's simple: Just set the registry key in your pre-print batch script (that of course requires that you have access to your desired output name at that time). It does not matter at which time you set the key, as long as it is set when you actually submit the job to the Adobe PDF printer. Distiller will remove the key after it's done, so you have to set it again the next time around (to a different name to avoid overwriting the first one).
We know the desired filename at the very begining of the process. I can set the registry key. However, since we call the print several times before we are done but we want one pdf file, I will have to combine the multiple pdf files. I will probably have to keep resetting the registry key before each print to filename_1, filename_2, etc. (where filename is our desired filename) so I can combine them at the end. I will be at the client on Wed and will try to test this out. I have to review the API to figure out the registry key and combine files syntax.
Thanks for your help. I'll let you know how it goes.
Alexis
Your first attempt may not work - because you may not know the correct application name. Do you have access to the application before you visit your client? If so, you should run a few tests to find out what the application uses as it's name when it initiates the print request.
Once way to do that is to check a different registry key. I describe the method in this question:
http://www.experts-exchang
(here is the one comment that you actually need from that discussion:
OK, then you may have the correct program filename. Use your application and print to the Adobe PDF printer, then open regedit and look in the PrinterJobControl key. There should be a new value with a name that starts with "LastPdfPortFolder - ", followed by the application name (unfortunately, it does not list the path). Is that the same application name that you've used?)
I think I understand what you are saying. Unfortunately, the applicaiton is an engineering app that I do not have access to unless I am there. I will do what you said and get the name from regedit. I know the app outputs all pdf files to the name vee.pdf but that may be different from what I will see in regedit.
Thanks again for all the details. I've never had to work with pdf file creation before. The project we are working on is very important to the company and this printing issue is the last hurdle and it is complete.
Regards,
Alexis
I set the registry key, however, when I tested using Wordpad as you suggested in some other posts, it doesn't work. The pdf file name is not going to where I wanted and doesn't have the filename I set. Plus, the registry key is still there after I print so I know something's wrong.
I attached a screenshot of the registry setting I created. Did I do something wrong? I installed Adobe Acrobat Professional 9.0 before I did any of this. Once I get the Wordpad example working, I will try to get it to work with the Vee application.
Thanks,
Alexis
I figured out the problem after doing more testing. Although my registry setting was correct, I had changed the Adobe Output PDF Folder setting from "prompt" to a physical folder. I thought maybe that was interfering with the registry. When I put the setting back to "prompt", and then ran Wordpad, it worked. Now I will try to write a batch script to change the setting so I can call it from the vee program. I'll let you know if I have any questions.
Thanks,
Alexis
Hi khkremer,
I tested manually setting the registry key for the vee application and the pdf file was created correctly. I reviewed various posts on windows scripting but I can't get a complete file written. I'd like to do this in VBScript. For now, I want to get it to work with the Wordpad example. I wrote a script below based on code I found but I don't know where to tell the script that the application is Wordpad. The two string values I manually entered in regedit under "HKEY_CURRENT_USER\SOFTWAR
Thanks,
Alexis
I am not familiar enough with VB to comment on your script - I'll try it anyways :)
If you look at the sample in the Adobe documentation, you'll see that the application name is actually part of the key (this is Adobe's Wordpad example):
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar
"C:\Program Files\Windows NT\Accessories\wordpad.exe
"c:\MyPDFoutputFileName.pd
The subkey in PrinterJobControl has the value of the PDF output path. As I said, I'm not an expert in VBS, but I searched a bit and found the following:
http://msdn.microsoft.com/
And I got the following code to work:
Business Accounts
Answer for Membership
by: khkremerPosted on 2008-10-29 at 11:39:15ID: 22834226
Starting with Acrobat 7, yes there is an easy way to configure the output filename (by setting a registry key), but this was not available in Acrobat 6. Can you upgrade Acrobat?
If not, you have some work to do: You first need to create a PostScript file, then you run Distiller (using the Distiller API that is documented by Adobe) to convert that PostScript file to a PDF file.