We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub Command2_Click() If Len(Me!txtFileName & "") = 0 Then MsgBox "The AM Update has not been attached!!", , "Warning" Cancel = True Exit Sub End If Me.WaitMessage.Visible = True Dim rst As Recordset Set rst = CurrentDb.OpenRecordset("AllMembersLive") Do While Not rst.EOF DoCmd.Save Dim SEmailBody1 As String Dim SEmailBody2 As String Dim SEmailBody3 As String Dim SEmailBody4 As String Dim SEmailBody5 As String SEmailBody1 = "Email text - removed for privacy" SEmailBody2 = "Email text - removed for privacy" SEmailBody3 = "Email text - removed for privacy" Dim mess_body As String Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem) Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem) With MailOutLook .BodyFormat = olFormatRichText .To = rst!Email .Subject = "Correlate Search - Weekly Update, " & Date .HTMLBody = SEmailBody1 & SEmailBody2 & SEmailBody3 If Left(Me.txtFileName, 1) <> "<" Then .Attachments.Add (Me.txtFileName) End If .DeleteAfterSubmit = True 'This would let Outlook send the note without storing it in your sent bin .Send End With 'MsgBox MailOutLook.Body 'Exit Sub rst.MoveNext Loop rst.Close Set rst = Nothing MsgBox "The AM Update has been sent!!", , "Success" Me.WaitMessage.Visible = False EH: If Err.Number = 2501 Then Err.Clear Resume Next End If End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.