Set Text As Bold using VB - Can Anyone Help ??

liammoohan

Board Regular
Joined
Jan 11, 2008
Messages
72
I have used the below code which generates an e-mail however I am trying to get a certain line to appear BOLD and UNDERLINED.

Does anyone know how I could get the line highlighted in RED to show IN BOLD and UNDERLINED when the e-mail is created?

Rich (BB code):
.Body = BodyMessage()

'-----------------------------------------------------------------------
'Function to create body message string
Private Function BodyMessage()
Dim s As String

s = "Hello" & Chr(10) & Chr(10) _
& "Your " & Request & " Request #" & RequestID & " has been raised." _
& Chr(10) & Chr(10) _
& "You will receive confirmation once your request has been completed." _
& Chr(10) & Chr(10)

s = s & "For Administration Use Only" _
& Chr(10) & Chr(10) _
& "Contact Strategy - " _
& "<\\Liam\Agent Administration Suite\CS>" _
    & "As file name " & SaveFileCS & ".xls" _
    & Chr(10)
    
s = s & "Human Resources - " & _
    "<\\Liam\Agent Administration Suite\HR>" _
    & "As file name " & SaveFileHR & ".xls" _
    & Chr(10)
s = s & "IT Support - " _
    & "<\\Liam\Agent Administration Suite\ITS>" _
    & "As file name " & SaveFileITS & ".xls" _
    & Chr(10)
    
s = s & "Caseflow - " _
    & "<\\Liam\Agent Administration Suite\CASEFLOW>" _
    & "As file name " & SaveFileCASEFLOW & ".xls" _
    & Chr(10)
    
s = s & "Security/Reception - " _
    & "<\\Liam\Agent Administration Suite\SECURITY>" _
    & "As file name " & SaveFileSECURITY & ".xls" _
    & Chr(10) & Chr(10)
    
s = s & "General Viewing - " _
    & "<\\Liam\Agent Administration Suite\GENERAL>" _
    & "As file name " & SaveFileGENERAL & ".xls"

BodyMessage = s

End Function
 
Last edited by a moderator:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Untested, but try wrapping it with bold and underline tags:

HTML:
s = s & "<b><u>For Administration Use Only</u></b>" _
 
Upvote 0
You can''t use just Body if you want to format the body of the email.

You need to use HTMLBody and construct the appropriate HTML along the lines of what Colin posted.

By the way we're assuming, well I am anyway, that you are using MS Outlook.:)
 
Upvote 0

Forum statistics

Threads
1,202,977
Messages
6,052,891
Members
444,609
Latest member
Fritz23

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