Lebans A2000ReportToPDF -> RTF to pdf ?

M

Miguel Pouliot

Hi,

I've been searching a day about converting to pdf format. Finally, i found
A2000ReportToPDF. Got to say that it works great !

I know that A2000ReportToPDF convert access reports to pdf but i would like
to know if it could be possible to do the same type of converting but with
rtf files ?

I'm asking that because where i work we prefer to use queries instead of
building reports. Faster...

Example :
DoCmd.OutputTo acOutputQuery, queryname, acFormatRTF, rtfFile

And then, i call the function ConvertReportToPDF using rtf file as a
pararemeter.

Thanks in advance !

Miguel
 
M

Miguel Pouliot

Still waiting for the answer but i found another way to convert an Access
Query to PDF file :

Private Function convertQueryToPDF(ByVal pQueryNAme As String, ByVal
pPDFfilePath As String) As Boolean

convertQueryToPDF = False

Dim lRetour As Boolean
Dim lngAddIn As Long
'Check Tools/References/AdobePDFMakerForOffice to make it works
Dim lPDFMaker As AdobePDFMakerForOffice.PDFMaker
Dim lPDFSettings As AdobePDFMakerForOffice.ISettings

For lngAddIn = 1 To COMAddIns.Count
If COMAddIns(lngAddIn).Description = "Acrobat PDFMaker Office COM
Addin" Then
Exit For
End If
Next


Set lPDFMaker = COMAddIns(lngAddIn).Object

DoCmd.OpenQuery pQueryNAme, acViewNormal, acReadOnly

'Usefull options
Set lPDFSettings = lPDFMaker.GetCurrentConversionSettings
lPDFSettings.OutputPDFFileName = pPDFfilePath
lPDFSettings.PromptForPDFFilename = False
lPDFSettings.ViewPDFFile = False

'Create the file on disk
lRetour = lPDFMaker.CreatePDFEx(lPDFSettings)

Set lPDFMaker = Nothing
Set lPDFSettings = Nothing

'Close the query
DoCmd.Close acQuery, pQueryNAme, acSaveNo

'An error as occured when creating the PDF
If lRetour = True Then
Exit Function
End If

convertQueryToPDF = True

End Function
 
B

Bill

Not an answer but a question. I'm using the same A2000ReportToPDF and need
to export only the current record. Right now it simply takes my report and
exports everything. Any help would be GREAT!

Thx
 
B

Bill

I looked and I tried. Still no luck. I've tried splitting the code to first
print the current record, then on open for the report tried to run the
ReportToPDF and getting a strange error “Microsoft Office Access can’t find
the field ‘|’
referred to in your expression."

Just can't figure this out... I'm still learning and you guys are blowing me
away with your helpfulness. So Thank you all for helping out a newbie!!!
 

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