+ Reply to Thread
Results 1 to 6 of 6

VBA code to send email to the people whose email address is in the Access table

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    VBA code to send email to the people whose email address is in the Access table

    Hi All

    I have specified the email addresses in the code to whom the email will be sent when the user presses "Send Email" button but now I want to add all the addresses in the Access table and write down the code that will send an email to those people whose addresses are in the Access table. Can anybody please change the code accordingly?

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA code to send email to the people whose email address is in the Access table

    What do you mean by Access table?

    Is this a table in the Access software.

    One way or another you need to build a string of email addresses separated by a ; and then use this string in the .To section of the 'With OutMail' section of code.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: VBA code to send email to the people whose email address is in the Access table

    Hi Richard,

    I am using Access as a backend and Excel as a frontend for my project. So I want all the addresses to be in the table of Access DB. and the code should send an email to the email addreses present in Access .

    Could you please help me in this?

    Thanks

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA code to send email to the people whose email address is in the Access table

    Hi,

    I'm not as au fait with Access and don't know how to read from Excel VBA to an Access Table.

    If it were me I'd link to the Access table from the Data..Get External Data...From Access menu and bring the table values into an Excel table. Then either code an Excel macro to loop down the list of eMail addresses and build the email string required mentioned in my last post. Or another way would be to use a normal Excel concatenate function to build the string into a cell and then read the cell value in the .To section of the email macro.

  5. #5
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: VBA code to send email to the people whose email address is in the Access table

    ok. If I write the vba code that will fetch all the values from the Access table named tblemail and populate all the values in the sheet1 of current workbook and then read the cell values in the .To section .

    Can you help me to write vba code for this?

    Thanks

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: VBA code to send email to the people whose email address is in the Access table

    Richard, I got all the email addresses in sheet1 of the workbook . So now how to add all those email addresses in the .To section of Sendemail function.

    Thanks for your help so far.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Code Help - If text found, send email to corresponding address.
    By spoliquin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2013, 12:04 PM
  2. Replies: 1
    Last Post: 03-08-2012, 01:57 PM
  3. Replies: 6
    Last Post: 12-02-2011, 02:14 PM
  4. VBA code to look up email address and send worksheet
    By JSB0009 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2010, 10:29 AM
  5. send email from XL list of email address
    By pauluk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2009, 11:36 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1