By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

Convert Access 2003 Report to Acrobat 7.0

P: n/a
I found code online which uses Windows API's to save Access reports to
pdf format files. I'm using the full version of Adobe Acrobat
Professional 7.0. The problem is that regardless of what I put in the
code as a filename it automatically saves the report based on the
report name instead of the string passed to the registry key. The code
is as follows:

'************************************************* *****************
'Setting value for PDFFileName in the registry
'stops file dialog box from appearing

bSetRegValue HKEY_CURRENT_USER, "Software\Adobe\Acrobat PDFWriter",
"PDFFileName", sPDFPath + sPDFName
'************************************************* *****************

The line of code passes the correct string for path and filename to the
registry which gets written properly but Acrobat still saves the file
as "reportname.pdf", where the name of the Access report converted to
pdf is "reportname", regardless of what the registry key says. I can't
find anywhere in the Acrobat print settings to override this. Help,
please.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
BikeToWork wrote:
I found code online which uses Windows API's to save Access reports to
pdf format files. I'm using the full version of Adobe Acrobat
Professional 7.0. The problem is that regardless of what I put in the
code as a filename it automatically saves the report based on the
report name instead of the string passed to the registry key. The code
is as follows:

'************************************************* *****************
'Setting value for PDFFileName in the registry
'stops file dialog box from appearing

bSetRegValue HKEY_CURRENT_USER, "Software\Adobe\Acrobat PDFWriter",
"PDFFileName", sPDFPath + sPDFName
'************************************************* *****************

The line of code passes the correct string for path and filename to the
registry which gets written properly but Acrobat still saves the file
as "reportname.pdf", where the name of the Access report converted to
pdf is "reportname", regardless of what the registry key says. I can't
find anywhere in the Acrobat print settings to override this. Help,
please.


So what you need to do is figure out where these "reportname.pdf" files
get saved, and add more code to your function to rename it how you want
it to be renamed, like in the report's OnClose event handler.

I've installed PrimoPDF (the free version), but haven't tried to control
it programmatically.

Not much need for full Acrobat these days for most purposes, but if
you've got it, then by all means use it.

Nov 13 '05 #2

P: n/a
corey lawson wrote:
BikeToWork wrote:
I found code online which uses Windows API's to save Access reports to
pdf format files. I'm using the full version of Adobe Acrobat
Professional 7.0. The problem is that regardless of what I put in the
code as a filename it automatically saves the report based on the
report name instead of the string passed to the registry key. The code
is as follows:

'************************************************* *****************
'Setting value for PDFFileName in the registry
'stops file dialog box from appearing

bSetRegValue HKEY_CURRENT_USER, "Software\Adobe\Acrobat PDFWriter",
"PDFFileName", sPDFPath + sPDFName
'************************************************* *****************

The line of code passes the correct string for path and filename to the
registry which gets written properly but Acrobat still saves the file
as "reportname.pdf", where the name of the Access report converted to
pdf is "reportname", regardless of what the registry key says. I can't
find anywhere in the Acrobat print settings to override this. Help,
please.


So what you need to do is figure out where these "reportname.pdf" files
get saved, and add more code to your function to rename it how you want
it to be renamed, like in the report's OnClose event handler.

I've installed PrimoPDF (the free version), but haven't tried to control
it programmatically.

Not much need for full Acrobat these days for most purposes, but if
you've got it, then by all means use it.\


I agree I could make a function which changes the filenames for the
batch of reports to be processed but this same code worked fine in
Acrobat 5.0 and it is passing the proper data to the registry key so it
must be some "feature" of Acrobat 7.0 that always uses the name of the
original report as the filename, regardless of what is in the registry
key. Argh! How I hate overly "user-friendly" software...

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.