putting text into BOLD in .SBODY

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,259
Office Version
  1. 2010
Platform
  1. Windows
Hi good morning, I am struggling to get the 'Please note' wording to be in bold, on the .SBody line. Please can you help, i have tried the <b> but that didn't work. I hope you can advise me please?

Code:
Sub Button3_Click()

Dim OutApp As Object
Dim OutMail As Object
Dim sTo As String, sCC As String, sSbject As String, sBody As String
Set OutApp = CreateObject("Outlook.Application")
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

ssubject = "Info"
sTo = "don.duck@talktalk.com"
sCC = "peter.rabbit@talktalk.com
sBody = "Hi, good afternoon." & vbCrLf & vbNewLine &  "[B]Please note[/B]"
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = sTo
.CC = sCC
.Subject = ssubject
.body = sBody
.Display
End With
End Sub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi

Change

Code:
.body = sBody

to

Code:
.HTMLbody = sBody

:)
 
Upvote 0
Code:
Sub Button3_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim sTo As String, sCC As String, sSbject As String, sBody As String
Set OutApp = CreateObject("Outlook.Application")
With Application
    .EnableEvents = False
    .ScreenUpdating = False
sSbject = "Info"
sTo = "don.duck@talktalk.com"
sCC = "peter.rabbit@talktalk.com"
[COLOR=#0000ff]sBody = "< b >Hi, good afternoon.< br >< br >Please note< /b >"[/COLOR]
Set OutMail = OutApp.CreateItem(0)
With OutMail
    .To = sTo
    .CC = sCC
    .Subject = sSbject
[COLOR=#0000ff]    .htmlbody = sBody[/COLOR]
    .Display
End With
    .ScreenUpdating = True
    .EnableEvents = True
End With
End Sub

From here : https://www.google.com.hk/search?q=...j69i57j0l3.34304j1j8&sourceid=chrome&ie=UTF-8
 
Last edited:
Upvote 0
^^ Sorry, should really mention that using the HTMLbody will let you use the;

HTML:
<b>

That you seemed to use when writing your post, or at least I'm assuming that is why your text suddenly went bold :)
 
Last edited:
Upvote 0
hi thank you for the advise :) but each line after the
Code:
& vbCrLf & vbNewLine &
are all in one and not gone on seperated line does a 'br' need to go in now to replace 'vbNewLine' please can you also advise where i put the bold code in please i want it in the same part as
Code:
& vbCrLf & vbNewLine &
, thank you for your help it is much appreciated. :)

Code:
Sub Button3_Click()

Dim OutApp As Object
Dim OutMail As Object
Dim sTo As String, sCC As String, sSbject As String, sBody As String
Set OutApp = CreateObject("Outlook.Application")
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

ssubject = "Handover on day"
sTo = "Don.duck@talktalk.com"
sCC = "Don.duck@talktalk.com"
sBody = "Hi , good afternoon." & vbCrLf & vbNewLine & "Please find attached ??" & vbCrLf & vbNewLine & "Please note" & vbCrLf & vbNewLine & "-   We started the day with ?? unscheduled" & vbCrLf & vbNewLine & "-   Sickness - " & vbCrLf & vbNewLine & "-   Vehicle breakdown -" & vbCrLf & vbNewLine & "-   System issues - " & vbCrLf & vbNewLine & "-   ECO - " & vbCrLf & vbNewLine & "-   Stores on day raised for - " & vbCrLf & vbNewLine & "-   In day today there was an additional  ?? ." & vbCrLf & vbNewLine & "-   Extra jobs raised for" & vbCrLf & vbNewLine & "on day." & vbCrLf & vbNewLine & "Paper Jobs" & vbCrLf & vbNewLine & "Escalations" & vbCrLf & vbNewLine & "Thank you" 

Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = sTo
.CC = sCC
.Subject = ssubject
.HTMLbody = sBody
.Display
End With
End Sub
 
Upvote 0
i have worked it out now, thank you so much for your help today much appreciated :)
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top