Print individual report pages to separate files

gschimek

Registered User.
Local time
Today, 14:44
Joined
Oct 2, 2006
Messages
102
I have a report that is basically a form letter. Each page is an identical letter to a different person. It functions just like a mail merge in Word would function.

Right now we mail out these letters. I'd like to be able to email them instead, which means I'd have to save each individual page of the report to a file. Right now I can either print 1 letter, or all the letters.

My preferred file format would be PDF, but everything I see about automatically creating them seems like it's a challenge. So I'll settle for RTF or even TXT if I have to.

I'd love for it to be automated, so the file name is automatically set based on the report (the person's name, for example). If I can get the pages printed and saved separately, I can write a script to email them out afterward.

I'm already using some code to be able to print the letters 1 at a time, so maybe there's a way to automate it with that code so that it prints each record separately, instead of just one or all. Here's that code:

Code:
Private Sub IndLetter_Click()
Dim strReportName As String
   Dim strCriteria As String
    DoCmd.RunCommand acCmdSaveRecord
   strReportName = "rptAcceptanceLetters"
   strCriteria = "[FullName]='" & Me![FullName] & "'"
   DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub

Or, any other suggestions are welcomed. Thanks in advance.
 

Users who are viewing this thread

Back
Top Bottom