Send E mail with Stored PDF/Excel Attachment

Ramu

Registered User.
Local time
Today, 20:01
Joined
Jun 21, 2003
Messages
23
Hi

I am very new to Access, but manged to create database using templates, now I would like to send mail with the stored attachment in the table (something like a news letter in PDF), can anyone help me how to do that

I have done many searches in the web, so may VB Code (don't know what do to)

Please help me to find a solution with simple steps, THANKS IN ADVANCE

:):):):):):)
 
Hi

I have managed to get some codes for the file attach through email, but it gives error as
Insert a FindRecord Action before the Findnext action, can anyone help me to correct this- THANKS A LOT

++++++++++++++++

Option Compare Database

Private Sub Command2_Click()
Call Selectfile

End Sub

Public Function Selectfile() As String
Dim Fd As FileDialog
Set Fd = Application.FileDialog(msoFileDialogOpen)
With Fd
.AllowMultiSelect = False
.Title = " Please select the Files"
If .Show = True Then
Selectfile = .SelectedItems(1)
Me.Text0 = Selectfile
Me.List3.AddItem (Selectfile)
Else
Exit Function
End If
Set Fd = Nothing
End With
End Function


Private Sub Command5_click()
On Error GoTo errhandlers:
Dim oOutlook As Outlook.Application
Dim oEmailItem As MailItem

If oOutlook Is Nothing Then
Set oOutlook = New Outlook.Application
End If
Set oEmailItem = oOutlook.CreateItem(olMailItem)
With oEmailItem
Set rs = CurrentDb.OpenRecordset("Select * from tbl_customer")
If rs.RecordCount > 0 Then
rs.MoveFirst
Do Until rs.EOF
If IsNull(rs!Email) Then
rs.MoveNext
Else
customerEmail = customerEmail & rs!Email & ";"
.To = customerEmail
rs.MoveNext
End If
Loop
Else
MsgBox "No Customer On the List"
End If
.CC = " "
.Subject = "Attach Files"
For n = 0 To Me.ListCount = 1
.Attachments.Add (Me.List3.ItemData(n))
Next n
.Display


End With
Exit_errhandlers:
MsgBox Err.Description, vbCritical
Resume Exit_errhandlers:
Exit Sub
 

Users who are viewing this thread

Back
Top Bottom