Output to PDF using Adobe Acrobat Professional?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way that I can set up my report export to export to a .pdf format?

I use Adobe Acrobat 6.0 Professional

Here is my current code that I use to export to .rtf:

Begin Code:

Private Sub cmdPrintPreview_Click()

Dim strReportName As String
Dim strCriteria As String
Dim strOutputName As String

Me.Dirty = False

If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]

DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then

strOutputName = "D:\Karma Imports\Program & Custom Orders\Custom
Orders\" & (Me!ordnum) & " - " & Format(Date, "mm_dd_yyyy") & ".rtf"

If Me.PrintOrder = False Then
Me.PrintOrder = True
Me.SystemPrintDate = Date
End If


DoCmd.OutputTo acOutputReport, strReportName, acFormatRTF,
strOutputName, True
End If

End If
End Sub


End Code

Thanks in advance

Brook
 
I set-up my printer to go to Acrobat Distiller by default.
To set the default output file, I build a text file .reg
that looks something like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ADOBE\Acrobat
Distiller\PrinterJobControl]
"LastPdfPortFolder - AOPUTLAP.exe"="X:\\Journals\\2005-
P05s3\\20AP_Vouchers"

Where AOPUTLAP.exe is the program that runs and X:\\Jo...
is the output directory directory .
You will want to chase down the registry tree to find the
correct value when you specify output manually.

In order to make the .reg file go into the registry, I run
an API call function that I got from this site:
www.mvps.org/access/api/api0018.htm

I hope this helps.
George
 
Thanks for the suggestion...

Will this option send all of my print jobs even outside of Access to Adobe?

Can I export to my hard drive with this option?

Thanks,

Brook

George said:
I set-up my printer to go to Acrobat Distiller by default.
To set the default output file, I build a text file .reg
that looks something like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ADOBE\Acrobat
Distiller\PrinterJobControl]
"LastPdfPortFolder - AOPUTLAP.exe"="X:\\Journals\\2005-
P05s3\\20AP_Vouchers"

Where AOPUTLAP.exe is the program that runs and X:\\Jo...
is the output directory directory .
You will want to chase down the registry tree to find the
correct value when you specify output manually.

In order to make the .reg file go into the registry, I run
an API call function that I got from this site:
www.mvps.org/access/api/api0018.htm

I hope this helps.
George



-----Original Message-----
Is there a way that I can set up my report export to export to a .pdf format?

I use Adobe Acrobat 6.0 Professional

Here is my current code that I use to export to .rtf:

Begin Code:

Private Sub cmdPrintPreview_Click()

Dim strReportName As String
Dim strCriteria As String
Dim strOutputName As String

Me.Dirty = False

If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]

DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then

strOutputName = "D:\Karma Imports\Program & Custom Orders\Custom
Orders\" & (Me!ordnum) & " - " & Format (Date, "mm_dd_yyyy") & ".rtf"

If Me.PrintOrder = False Then
Me.PrintOrder = True
Me.SystemPrintDate = Date
End If


DoCmd.OutputTo acOutputReport, strReportName, acFormatRTF,
strOutputName, True
End If

End If
End Sub


End Code

Thanks in advance

Brook
.
 
Changing your default printer will cause everything to go
to Acrobat Distiller. You have to change it back
afterward.

There is probably a way to programatically change it, but
I don't know it.

Your question prompted me to go back to:
www.mvps.org/access/
where I typed "Printers" into the Search option.
That led me to a whole new world of techniques for
potentially changing printers. (Thanks!)
Specifically, I found "On the Fly Printing" Functions, and
PDF and Mail Class Library for Access" at:
http://ourworld.compuserve.com/homepages/attac-
cg/acgsoft.htm
Apparently some of these techniques will cost you a little.

Look around www.mvps.org/access/ and see what you learn.
Good luck.
George

Good luck.

George


-----Original Message-----
Thanks for the suggestion...

Will this option send all of my print jobs even outside of Access to Adobe?

Can I export to my hard drive with this option?

Thanks,

Brook

George said:
I set-up my printer to go to Acrobat Distiller by default.
To set the default output file, I build a text file .reg
that looks something like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ADOBE\Acrobat
Distiller\PrinterJobControl]
"LastPdfPortFolder - AOPUTLAP.exe"="X:\\Journals\\2005-
P05s3\\20AP_Vouchers"

Where AOPUTLAP.exe is the program that runs and X:\\Jo...
is the output directory directory .
You will want to chase down the registry tree to find the
correct value when you specify output manually.

In order to make the .reg file go into the registry, I run
an API call function that I got from this site:
www.mvps.org/access/api/api0018.htm

I hope this helps.
George



-----Original Message-----
Is there a way that I can set up my report export to export to a .pdf format?

I use Adobe Acrobat 6.0 Professional

Here is my current code that I use to export to .rtf:

Begin Code:

Private Sub cmdPrintPreview_Click()

Dim strReportName As String
Dim strCriteria As String
Dim strOutputName As String

Me.Dirty = False

If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]

DoCmd.OpenReport strReportName,
acViewPreview, ,
strCriteria
If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then

strOutputName = "D:\Karma Imports\Program & Custom Orders\Custom
Orders\" & (Me!ordnum) & " - " & Format (Date, "mm_dd_yyyy") & ".rtf"

If Me.PrintOrder = False Then
Me.PrintOrder = True
Me.SystemPrintDate = Date
End If


DoCmd.OutputTo acOutputReport, strReportName, acFormatRTF,
strOutputName, True
End If

End If
End Sub


End Code

Thanks in advance

Brook
.
.
 
We sell source code to automate pdf generation from Access. Currently our
module only support win2pdf and PDFWriter version 5.x and below.

If interested take a look,
Mark
RPT Software
http://www.rptsoftware.com

PS: Most pdf printer drivers work in conjunction with registry settings, so
it's probably pretty easy to adapt our code to other pdf drivers.
 
Brook
Try looking in
Access 2000 Developer's Handbook, Volume I
by Getz, Litwin, and Gilbert (Sybex)

I found how to do it in the examples they have on a CD they use as examples.
 
Well that code will output to an RTF file.

If you want to automate output to a PDF file using Acrobat 4,5,6 or 7, then
take a look at our PDF and Mail Library for Access, it supports all those
versions. You'll find it on our web in our Developer Tools area.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

LD said:
Brook
Try looking in
Access 2000 Developer's Handbook, Volume I
by Getz, Litwin, and Gilbert (Sybex)

I found how to do it in the examples they have on a CD they use as
examples.


Brook said:
Is there a way that I can set up my report export to export to a .pdf
format?

I use Adobe Acrobat 6.0 Professional

Here is my current code that I use to export to .rtf:

Begin Code:

Private Sub cmdPrintPreview_Click()

Dim strReportName As String
Dim strCriteria As String
Dim strOutputName As String

Me.Dirty = False

If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]

DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then

strOutputName = "D:\Karma Imports\Program & Custom Orders\Custom
Orders\" & (Me!ordnum) & " - " & Format(Date, "mm_dd_yyyy") & ".rtf"

If Me.PrintOrder = False Then
Me.PrintOrder = True
Me.SystemPrintDate = Date
End If


DoCmd.OutputTo acOutputReport, strReportName, acFormatRTF,
strOutputName, True
End If

End If
End Sub


End Code

Thanks in advance

Brook
 
Back
Top