Format email body - underline or bold

Leo_Polla_Psemata

Registered User.
Local time
Today, 08:31
Joined
Mar 24, 2014
Messages
364
Hi
With the below code, I produce and send emails, the text is displayed properly on the outlook email body.

Code:
Private Sub Report_Current()

Dim RsEmail as dao.recordset
set RsEmail = currentdb.openrecordset ("your table name")
With rsEmail
sMessageBody = "Email body Text"
Do Until .EOF
sMessageBody = sMessageBody & vbCrLf & .Fields("POL") & " " & .Fields("POD") & "" & .Fields("R20") & "" & .Fields("R40")
.MoveNext
Loop

DoCmd.SendObject , , , , , , "test test", sMessageBody, True, ""

End With
End Sub

Is there any way I could format the text a little bit ?
I mean, underline some text part ?

For example, this magic vbCrLf feeds new line.
Is there any other "magic" which you type and underlines ?
 
According to this link you can only send plain text using DoCmd.SendObject. To add formatting the email would have to be in HTML format which you can do using Outlook Automation. FMS has a product you can buy for about $300 that would help you or this link has some code that could get you started.
 
I think you can put your text in RTF (rich text format) and rewrite your string (the one you would underline) for example as follows:
Code:
sMessageBody = "Email <u> body </u> Text"
 

Users who are viewing this thread

Back
Top Bottom