Send E-mail

amfroehlich

Board Regular
Joined
Jul 14, 2004
Messages
192
I am sending an e-mail via Access with this code:

Dim olApp As Object, olMail As Object
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "abc@xyz.com"
.Subject = "Record Updated"
.Body = "A record has been updated"
.DeleteAfterSubmit = True
.Send
End With
Set olMail = Nothing
Set olApp = Nothing

I am wanting to add an snapshot of a report as an attachment. How do yo do this???

Please Help. Thanks.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
hi, try this:

Code:
Sub SendSnapshot()
Dim strDocName As String
Dim strOutputFormat As String
Dim strAddress As String
Dim strSubject As String
Dim strBody As String

    strDocName = "rptYourReport"
    strOutputFormat = "Snapshot Format"
    strAddress = "abc@xyz.com"
    strSubject = "Record Updated"
    strBody = "A record has been updated"

    DoCmd.SendObject acSendReport, strDocName, _
        strOutputFormat, strAddress, , , _
        strSubject, strBody, 0
End Sub

Your recipient would need to have the snapshot viewer installed!

hope it helps..
 
Upvote 0

Forum statistics

Threads
1,221,825
Messages
6,162,190
Members
451,752
Latest member
majbizzaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top