Bulk email from Access

  • 10 years ago
    I have built a user database which has been pretty much doing what I wanted it to do.  However, I am unable to send to email to selected people from the database or indeed the entire list.  One column contains all the email addresses, and so far I go through a complicated cprocess of cutting and pasting into word, deleting all the spaces, adding comma's between each address and then pasting into an email.  There must be an easier way. Can anybody help?
  • 10 years ago
    If you're not too bothered about cutting and pasting into the actual email form, why not create a function (like the following) that helps you out:

    Private Function GetEmailAddresses() As String

        Dim list As String
        Dim rs As DAO.Recordset
        Set rs = CurrentDb.OpenRecordset("select EmailAddress from xxx")

        If Not rs Is Nothing Then  
          
            While Not rs.EOF
                list = list & rs(0).Value          
                rs.MoveNext          
                If Not rs.EOF Then
                    list = list + ";"
                End If
            Wend
           
            rs.Close
            Set rs = Nothing
           
            GetEmailAddresses = list
           
        End If
       
    End Function

    You could then use a macro or something to call the function.




























Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Anyone who considers arithmetic methods of producing random digits is, of course, in a state of sin.” - John von Neumann