Log in

View Full Version : change font on the body of the message



kelbevin
12-05-2007, 11:01 AM
Hello there, I am trying to figure out how to change the font size to 12 and style to bold on part of the message body. Can someone help me?

In the following example, I am trying to bold "your account have an outstanding balance of"

Sub SendEmail()
Dim OutlookApp As Object
Dim MItem As Object
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Recipient As String
Dim Debit As String
Dim Name As String
Dim id As String
Dim Start As String
Dim Msg As String

Set OutlookApp = CreateObject("Outlook.Application")

For Each cell In Columns("A").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "*@*" Then

Recipient = cell.Offset(0, 1).Value
EmailAddr = cell.Value
Debit = Format(cell.Offset(0, 2).Value, "$000.00")
Start = cell.Offset(0, 3).Value


Subj = "Oustanding Balance for " & Name

Msg = "Hello " & Recipient & vbCrLf & vbCrLf
Msg = Msg & "your account have an outstanding balance of" & vbTab & Debit & vbCrLf
Msg = Msg & "Please deposit funds to eliminate the current debit." & vbCrLf & vbCrLf
Msg = Msg & "Thank you," & vbCrLf & vbCrLf



Set MItem = OutlookApp.CreateItem(0)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
.Sent

End With
End If
Next
End Sub

Thanks a lot.

Norie
12-05-2007, 11:24 AM
The only way I know this is possible is by using HTMLBody instead of just Body.

And to do that the first thing you need is the appropriate HTML code.