Home  Fees/Services  Access Templates  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

Access VBA Tutorial
   
Access Programming Examples
Sending Reports in Email to MS Outlook

RTF Report Send Via Email Visual Basic Tutorials for Access 2007 VBA
Access 2007 Tutorial>Visual Basic Tutorial>RTF Report Email Download VBA Tutorials  



Age Calculation
VBA Change Case
Calculate Running Sum
Concatenate Records
VBA CreateQueryDef
Database Path
Detail-Master Update
Field Validation VBA
Field Value New-Old
FindFirst Recordset
Get Version Number
VBA Global Parameters
VBA Global Variables
Labels as Links
VBA Outlook Email
List Box Files List
VBA Mail Merge
OutputTo Crosstab
Read Email Access
Sort Recordset
VBA Recordset Filters
Reference Form Field
RTF Report Email
VBA Select Case
VBA Transaction Processing

Visual Basic Function Examples


Email RTF Report Attachment VBA Example

Send Microsoft Access Report as Outlook or Other Email Attachment

Here is a simple method for mailing an Access report to someone.

This example uses the docmd.sendobject so email the report in rich text format (RTF).

This method should work with any email program running on your PC.  Here's the code:

Public Sub MailIt()

On Error GoTo Error_MailIt

Dim Rst As Recordset

‘ open the table that the report reads to make sure there is a record in it.

Set Rst = CurrentDb.OpenRecordset("EmailRpt", & _ DB_OPEN_DYNASET)

If Not Rst.BOF Then

    DoCmd.SendObject acReport, "RptEmailAdjustment", & _
    "rich text format (*.rtf)", strEmailAddressGlobal, , , & _
    StrSubjectGlobal ,  StrMessageGlobal

End If

    Goto OK_Exit:

Error_MailIt:

    MsgBox Error$ & " MailIt " GoTo Exit_MailIt

    Resume OK_Exit

OK_Exit:

    Rst.Close

    Set Rst = Nothing

End Sub

(submitted by Mary Roberge)




Contact Information

Programming Visual Basic Tutorial

Access Visual Basic/VBA/VBScript/VB6 2007 2003 2000