Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email to more than 1 email address (Access 2000)

    I'm using the following code to email to persons. I have a table tblAllCalls>R30_DivList with the DivName and Email. I would like to include more than one recipients in the email field

    Set DB = CurrentDb
    Set rs = DB.OpenRecordset("tblAllCalls>R30_DivList", dbOpenDynaset)
    Set DivisionName = rs![DivName]
    Set DivEmail = rs![Email]
    strEmailHeader = "Calls"
    strEmailBody = "This spreadsheet"

    Do While rs.EOF = False

    strTblEmailed = "tblAllCalls>R30"
    DoCmd.OpenTable "tblAllCalls>R30", acNormal, acReadOnly
    DoCmd.SelectObject acTable, "tblAllCalls>R30", False
    DoCmd.ApplyFilter "", "[tblAllCalls>R30]![DivName]=" & Chr(34) & DivisionName & Chr(34)
    DoCmd.SendObject acTable, strTblEmailed, "MicrosoftExcelBiff8(*.xls)", DivEmail, "", "", strEmailHeader, strEmailBody, False, ""
    rs.MoveNext

    Loop
    DoCmd.Close acTable, "tblAllCalls>R30"

    Thanks for any ideas

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Email to more than 1 email address (Access 2000)

    From the online help for the "To" argument:

    Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon ([img]/forums/images/smilies/wink.gif[/img] or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel.

    And the example from the online help:

    DoCmd.SendObject acSendTable, "Employees", acFormatXLS, _
    "Nancy Davolio; Andrew Fuller", "Joan Weber", , _
    "Current Spreadsheet of Employees", , False

    So you can put more than one recipient in the Email field, separated by semicolons, or you must have another way to retrieve the recipients for a specific record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •