+ Reply to Thread
Results 1 to 7 of 7

customised message and tables in multiple emails

  1. #1
    Registered User
    Join Date
    02-12-2021
    Location
    SINGAPORE
    MS-Off Ver
    2016
    Posts
    4

    customised message and tables in multiple emails

    Hi all

    I'm new to VBA and been trying to figure out how to send multiple emails to different recipients individually, with customised messages, with tables included.
    I've done this thus far and been stuck since as i can't seem to modify the codes that I've searched online. Hope to seek some advice here. thanks!

    the outcome I've been trying towards is to have each individual email with customised msg and table. Meaning, even though my spreadsheet as 4 to 5 rows of records, but each email i only require 1 record of the respective recipients.
    .
    .
    .

    Sub TextBox1_Click()
    Dim OApp As Object, OMail As Object, Signature As String, rng As range
    Dim cnt As Integer
    Dim i As Integer




    MsgBox "Are you sure you wanna mass send?"

    Set OApp = CreateObject("Outlook.Application")

    Set ws = Worksheets("Sheet1")
    cnt = ws.Cells.SpecialCells(xlCellTypeLastCell).Row

    For i = 2 To cnt Step 1 'Start from Row 2, increase by 1 till end of row

    Set OMail = OApp.CreateItem(0)




    On Error Resume Next



    With OMail
    .To = Worksheets("Sheet1").range("H" & i)
    .Subject = "Mass HSP email"
    htmlbodytext = "Dear " & range("A" & i).Value & range("B" & i).Value & "," & vbNewLine & vbNewLine & _
    "<ol><li> Pls note that...</li>" & vbNewLine & vbNewLine & _
    "<li> Kindly proceed to ..</li>" & vbNewLine
    .HTMLBody = htmlbodytext
    .display
    End With
    On Error GoTo 0

    Application.Wait (Now + TimeValue("0:00:02"))
    'Application.SendKeys "^~", True


    Set OMail = Nothing
    Next i

    Set OApp = Nothing

    End Sub
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: customised message and tables in multiple emails

    Is this what you mean?
    Please Login or Register  to view this content.
    See attached

    Note, according to the forumrules you have to put your code between code tags, you can do that with the # button.
    Attached Files Attached Files
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-12-2021
    Location
    SINGAPORE
    MS-Off Ver
    2016
    Posts
    4

    Re: customised message and tables in multiple emails

    Hi! thanks for the reply! not sure if my previous went through but wanted to ask if it's possible to make it in a table format? with a shaded first row for the headings, and the 2nd row/record are the respective header's info?
    see attachedAttachment 718882

  4. #4
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: customised message and tables in multiple emails

    Your attachment is invalid

  5. #5
    Registered User
    Join Date
    02-12-2021
    Location
    SINGAPORE
    MS-Off Ver
    2016
    Posts
    4

    Re: customised message and tables in multiple emails

    Are you able to see now? I could access on my end though.i uploaded from my desktop
    Attached Images Attached Images

  6. #6
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: customised message and tables in multiple emails

    Is this what you mean?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-12-2021
    Location
    SINGAPORE
    MS-Off Ver
    2016
    Posts
    4

    Re: customised message and tables in multiple emails

    Hi!

    Thanks for the prompt reply!
    Actually what I was referring to is have the email message with the table in it(the image I've attached). Sorry if I was unclear previously. Thanks!!

+ 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. Is it possible to put a customised message when error occur anywhere in USERFORM
    By vatsalgos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2020, 03:21 PM
  2. copying charts and tables into emails
    By stephme55 in forum Excel General
    Replies: 0
    Last Post: 06-21-2016, 06:12 PM
  3. [SOLVED] Macro To Send Emails with PDF: Multiple Emails and PDF's
    By totoga12 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-19-2014, 06:13 PM
  4. Replies: 2
    Last Post: 05-09-2013, 09:56 PM
  5. Inserting multiple customised date in the body with =Now()-1 etc function
    By Juzenzi in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 02-24-2013, 04:06 PM
  6. Send outlook emails with message in cells to individual emails associated with them
    By abinayan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 06:11 AM
  7. Replies: 2
    Last Post: 08-24-2005, 09:05 AM

Tags for this Thread

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