Email record or screen capture

C

Cruisinid

I'm extremely new at this...

I would like to create a macro(?) that would send a copy of a record to the
user and the user's manager once the entries are complete. When I've tried
to use the command buttons to create this, the only option is to send all the
data and not just the current record. Is what I am trying to accomplish
do-able?? Do I need to create a screen capture.. and if so, how do I send it
using Outlook?

Thank you
 
S

scott04

I use somthing like this to email a report. Maybe it will help you
out....Please note that if you plan on using outlook you go into the
properties in the code window and click on tools...references and select the
option for outlook otherwise the code will not know what the heck you are
trying to reference

Private Sub Email_Click()
On Error GoTo ProcError
Dim strPath As String
Dim rst As DAO.Recordset
Dim AppOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set AppOutLook = CreateObject("Outlook.Application")
Set MailOutLook = AppOutLook.CreateItem(olMailItem)
Dim EContent As String
Dim stDocName As String
If Me.Status = 3 Then
strPath = CurrentProject.Path
DoCmd.OutputTo acOutputReport, "This is the name of the report",
acFormatRTF, strPath & "\This is whatever id like to call the report name in
the attachment ex PendingReport.rtf", False, ""
MsgBox "The selected report have been exported to your desktop " & "file
PendingReport.rtf" & vbCrLf & "in the folder:" _
& vbCrLf & strPath, vbInformation, "Export Complete..."
With MailOutLook
..To = "enter email address"
..Subject = "enter what you want your subject line to read"
..Importance = olImportanceHigh
..Attachments.Add strPath & "\PendingReport.rtf"
..Body = "Enter the what you'd like your body to read."
..Save
..Send
End With
ElseIf Me.Status = 1 Or 2 Then
MsgBox "You tried to email a record that you didnt complete. Please mark
file complete if necessary", vbCritical
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, , _
"Error in cmdExportToExcel_Click event procedure..."
End If
End Sub
 

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