Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HOW: print access 2000 reports to pdf using vb code?

3 views
Skip to first unread message

Silencer

unread,
Jan 9, 2002, 3:07:49 PM1/9/02
to
How can you print access 200 reports to pdf without the user having to fill
in any dialogue boxes or manually goto print themselves? Ive seen a few
sites where you can purchase add-ins that output access reports to pdf
completely automatically
(http://ourworld.compuserve.com/homepages/attac-cg/acgsoft.htm) - but I
really dont want to use an addin, I'd rather develop the code and be able to
implement it myself. Apparently adobe (www.adobe.com) has some examples on
their site explaining how to do this, but I cant seem to find them. If
anyone has any knowledge of how this would be done, please email me or reply
to this post!! Thanks!


Silencer

unread,
Jan 9, 2002, 3:11:38 PM1/9/02
to
Thats Microsoft Access "2000" not "200", just correcting the typo there heh.
"Silencer" <b...@michaelsengineering.com> wrote in message
news:zp1%7.13092$Xs4.3...@feed.centurytel.net...

Larry Menzin

unread,
Jan 9, 2002, 3:34:01 PM1/9/02
to
You can set PDFWriter as your default printer and run
Access reports that will print to PDF. However, you need
to set the file name the report is written to. This is
done using the following API call:

Declare Function WriteProfileString Lib "kernel32"
Alias "WriteProfileStringA" _
(ByVal lpszSection As String, ByVal lpszKeyName As
String, ByVal lpszString As String) As Long

Once that is done, you could use the following function to
set the file name:

Public Function WritePDFFileName(PDFFileName As String) As
Long

Dim x As Long, Y As Long
'ReturnedValue = vbNull
'DefaultValue = vbNull

Y = WriteProfileString("Acrobat PDFWriter", "PDFFileName",
PDFFileName)

Once the file name is set, you could use DoCmd.Openreport
to print it to the file.

>.
>

0 new messages