ACG PDF and Mail

S

SAC

I'm using the ACG PDF and Mail add on. If anyone is familiar with this I
would appreciate some help.

I'm looping through a list of customer names on a report and making a new
pdf for each customer so I can email it to each of them.

The customer name is in a group header and the details in the detail
section.

The first one works fine, but then I don't get any details for the second
one. Any ideas?

Thanks.
 
S

SAC

Woops! Here's the code:

Function ContainerSealEmail()

'On Error GoTo Err_Command68_Click
'Use the .PDFEngine property to specify which PDF printer that should be
used. The constants are:
'Acrobat PDFWriter = 1
'Acrobat Distiller and Adobe PDF = 2 (PDF Pro and Pro Plus Only)
'Win2PDF = 3
'Fine Print pdfFactory = 4
'PDF995 = 5
'The default PDFEngine is Acrobat PDFWriter; if using any other PDF printer
to output the PDF file, then specify the appropriate PDF printer driver in
the .PDFEngine property.

'1.) -------------------------------------------------------

Const PDFENGINE_PDFWRITER = 3
Dim objPDF As New PDFClass
Dim lngResult As Long
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
strSQL = ""
Set db = CurrentDb
Set rs = db.OpenRecordset("qryContainerSealSum", dbOpenDynaset)


Do While Not rs.EOF

With objPDF
.PDFEngine = PDFENGINE_PDFWRITER
.ReportWhere = "[Cnme] = '" & rs!CNME & "'"
.ReportName = "rptContainerSeal"
.OutputFile = "c:\ContainerSeal.pdf" & rs!CNME & ".pdf"
.PrintImage
lngResult = .Result
End With
rs.MoveNext
Loop
Set objPDF = Nothing

Exit_Command68_Click:
Exit Function

Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click
End Function
 

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