Report to PDF

S

SF

Hi,

I am trying to automate the process of exporting report to PDF. I found the
code below:

http://www.tek-tips.com/faqs.cfm?fid=2533

I got compile error at " below

Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long
Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias _

How do I fix this error?

SF
 
B

bcap

" is the HTML escape sequence for a double quote mark. For some reason
it has been rendered literally on that web page instead of being displayed
as a quote mark.

Wherever " appears in that code, you need to replace it with a double
quote mark. Thus the code snippet you posted should look like this:

Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long
Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias _

I haven't studied the code at that page, but I would think that there may be
other escape sequences that haven't been rendered correctly and also need to
be replaced. See here for a list of them:

http://www.html-reference.com/Escape.htm

I take it that you noticed this "Important Note" on the page where you got
the code: "You must have Adobe Writer (which you have to purchase) in order
for this to work."

If you don't have Adobe Writer, then you have other options including:

If you are using Access 2007, you can download the free pdf add-in from
Microsoft and away you go (note that it has a bug whereby underlines don't
appear in the output).

Some people swear by this:

http://www.lebans.com/reporttopdf.htm

I have successfully used this:

http://www.win2pdf.com/

(note: this latter comes with a modest licence fee for commercial use)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top