Access.2007.VBA.Bibl..

(John Hannent) #1

Emailing Exported Text Files ............................................................................................


Once you have created text files from your Access data, you might want to email them to others
who need to review the data. Clicking the “Send Job Lists to Contacts” button opens a form
(shown in Figure 10-34) where you can select multiple contacts, and a job file (either .csv or .txt)
to send as an attachment to the selected contacts. The figure also shows three email messages with
the selected job file attachment.

FIGURE 10.34
A form for selecting contacts and a job file to email to them, with three email messages created from
the form.

The cmdMergetoEMailMulti_Click event procedure is listed below:

Private Sub cmdMergetoEMailMulti_Click()

On Error GoTo ErrorHandler

Dim strJobFile As String

Set lst = Me![lstSelectContacts]

Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf