Auto populate mail and attach report

craigprice

Registered User.
Local time
Today, 03:13
Joined
Apr 8, 2013
Messages
44
Hi,

I have a form where I need a button that will export the current record being viewed to a TXT file and attach to email, I want to specify the To, CC, Subject and Body of the email, if possible putting a flag on it also.

I'm not doing very well, so far I have

Code:
Private Sub MailExec_Click()
On Error GoTo Err_MailExec_Click
    Dim stDocName As String
    stDocName = "Executive Incidents"
    DoCmd.SendObject acReport, stDocName, acFormatTXT, email.To = "[EMAIL="test@test.com"]test@test.com[/EMAIL]"
Exit_MailExec_Click:
    Exit Sub
Err_MailExec_Click:
    MsgBox Err.Description
    Resume Exit_MailExec_Click
    
End Sub

This now doesnt seem to be working, if I remote email.To= then it does however this only creates a blank email with attachment.
 

Users who are viewing this thread

Back
Top Bottom