Elwood
Four Fried Chickens
- Local time
- Yesterday, 23:01
- Joined
- Jul 13, 2004
- Messages
- 5
I have an attachment field in my table where PDF files are stored. Is it possible set a button up to email the stored attachment using a macro or maybe some code behind a button?
This is code I used to email a report as a PDF.
Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click
Dim stDocName As String
Dim stMsg As String
‘Dim stAddress As String
Dim stSubject As String
stMsg = "See Attachment"
stDocName = "rptBoloMain"
‘stAddress = Emil@mail
stSubject = "Requested File”
DoCmd.OpenReport stDocName, acPreview, , "[ID]=" & Me![ID]
DoCmd.SendObject acSendReport, stDocName, acFormatPDF, stAddress, , , stSubject, stMsg, True
Exit_Command95_Click:
Exit Sub
Err_cmdEmail_Click:
MsgBox Err.Description
Resume Exit_cmdEmail_Click
End Sub
This is code I used to email a report as a PDF.
Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click
Dim stDocName As String
Dim stMsg As String
‘Dim stAddress As String
Dim stSubject As String
stMsg = "See Attachment"
stDocName = "rptBoloMain"
‘stAddress = Emil@mail
stSubject = "Requested File”
DoCmd.OpenReport stDocName, acPreview, , "[ID]=" & Me![ID]
DoCmd.SendObject acSendReport, stDocName, acFormatPDF, stAddress, , , stSubject, stMsg, True
Exit_Command95_Click:
Exit Sub
Err_cmdEmail_Click:
MsgBox Err.Description
Resume Exit_cmdEmail_Click
End Sub