Output to PDF using Adobe Acrobat Professional?

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
 
G

George

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
 
G

Guest

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
.
 
G

George

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
.
.
 
M

Mark Andrews

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.
 
G

Guest

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.
 
S

SA

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
 

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