Change pdf filename programmatically using Adobe Acrobat 6.0 Professional
Posted on 2008-10-29
Hi. 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 & "'"
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.