Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output report as a PDF attachement

Status
Not open for further replies.

friendlyplanet

Technical User
Jul 30, 2009
2
US
I know there have been threads addressing this issue but I am working with minimal code knowledge. I work within an access database which exports a customer confirmation report as an .rtf email attachment. I'm interested to know how to export as a pdf attachment for both aesthetic purposes (as the attachment loses a fair amount of the report's formatting) and retain the integrity of the information sent (ie. not having a customer change the information). The code I've found on the forums is too advanced for me to fully make out and manipulate to work with my needs. I have both PDF writer and distiller capabilities. Below is the code used now for the email. Anyone able to help? Thanks in advance!

Kate

Private Sub sendword_Click()
On Error GoTo Err_sendword_Click

Dim emaily As Integer
Dim stDocName As String
stDocName = "Confirmation"
Dim Mysubject As String
Mysubject = "Friendly Planet Travel Confirmation"
Dim Mymailname As String
Mymailname = Me.EmailName.Value
Dim MyBodyText As String
MyBodyText = "Dear Traveler, " & vbCrLf & _
"Attached is your reservation confirmation. This confirmation is a summary of the services you have" & _
" reserved with us. Please be sure that we have written your name as it appears on your passport and " & _
"that all details are according to your reservation request." & vbCrLf & _
"Cordially, The Friendly Planet Travel Team" & _
""

Dim mailname As String
mailname = Me.Text60.Value
'DoCmd.SendObject acReport, stDocName, acFormatRTF, Mymailname, , , Mysubject, MyBodyText, True
DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, "C:\Confirmation\Confirmation.rtf", False
emaily = SendE_Mail(Mysubject, mailname, MyBodyText)
'MsgBox "hi, testing", vbOKOnly, testing

Exit_sendword_Click:
Exit Sub

Err_sendword_Click:
MsgBox Err.Description
Resume Exit_sendword_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top