+ Reply to Thread
Results 1 to 5 of 5

Change font, size, color for part of email body

  1. #1
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Change font, size, color for part of email body

    hello!
    I use this code for email and I want to have different font text, size and color for it.
    I appreciate your help!

    HTML Code: 
    also posted here
    http://www.mrexcel.com/forum/showthread.php?t=624949
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Change font, size, color for part of email body

    Create the text with the required formatting in an online HTML editor, such as http://www.html.am/html-editors/online-html-editor.cfm, and copy the source into the HTMLbody string.

  3. #3
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Change font, size, color for part of email body

    Thank you!
    I tried but...it's over my head!

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Change font, size, color for part of email body

    solved
    HTML Code: 

  5. #5
    Registered User
    Join Date
    02-24-2015
    Location
    Bangladesh
    MS-Off Ver
    2010
    Posts
    1

    Re: Change font, size, color for part of email body

    I am very new in excel macro. Recently i made a macro for auto email. But i have a problem. How to bold text or color cell on email body in excel macro? Is anyone can solve this problem? It is urgent.

    In below i have given the macro.

    Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    Sub SendEMail()
    Dim Email As String, Subj As String
    Dim Msg As String, URL As String
    Dim r As Integer, x As Double
    For r = 11 To 14 'data in rows 1-12
    ' Get the email address
    Email = Cells(r, 12)

    ' Message subject
    Subj = "Margin of your Portfolio L - " & Cells(r, 1)

    ' Compose the message
    Msg = ""
    Msg = Msg & "Dear Mr. " & Cells(r, 2) & "," & vbCrLf & vbCrLf
    Msg = Msg & "This is to inform you that as of " & Cells(r, 6) & "," & " your Equity-Debt ratio in the portfolio maintained with LankaBangla Investments Limited (LBIL) has dropped to " & Cells(r, 5) & " per cent," & " Whereas our minimum required ratio is 30 per cent. The equity of your portfolio has dropped to Tk. " & Cells(r, 4) & "/-" & " against loan outstanding Tk. " & Cells(r, 3) & "/-." & vbCrLf & vbCrLf

    Msg = Msg & "In order to maintain your Equity-Debt ratio to the desired 30 level, you are advised to deposit the amount of Tk. " & Cells(r, 10) & "/-" & " or sell securities equivalent to the amount of Tk. " & Cells(r, 11) & "/-" & " within " & Cells(r, 7) & "." & vbCrLf & vbCrLf
    Msg = Msg & "We thank you for your consideration and assure you our best service at all times." & vbCrLf & vbCrLf
    Msg = Msg & "Please feel free to contact the following persons for any further clarifications." & vbCrLf & vbCrLf
    Msg = Msg & "1. Mohsin Ahammad, Manager, Credit Administration 01766669545" & vbCrLf
    Msg = Msg & "2. Syed Saniat Ahmmad, Senior Executive, Credit Administration 01766669544" & vbCrLf & vbCrLf

    Msg = Msg & "Please note that, in case of your taking no action within the given time, we will be forced to sell your portfolio (partially) to improve the ratio as per Margin Rule article no. 2.6-2.8 of BSEC." & vbCrLf & vbCrLf & vbCrLf
    Msg = Msg & "Thanking you." & vbCrLf & vbCrLf & vbCrLf

    Msg = Msg & "Sincerely," & vbCrLf & vbCrLf
    Msg = Msg & "LankaBangla Investments Limited" & vbCrLf

    ' Replace spaces with %20 (hex)
    Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
    Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

    ' Replace carriage returns with %0D%0A (hex)
    Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
    ' Create the URL
    URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

    ' Execute the URL (start the email client)
    ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus

    ' Wait two seconds before sending keystrokes
    Application.Wait (Now + TimeValue("0:00:02"))
    Application.SendKeys "%s"
    Next r
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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