I use a series of formulas and user inputs to generate a series of text entries which will then comprise the body of an email. This is the code that is working for me at present:
Code
Dim OutApp As Object
Dim OutMail As Object
Dim EmailBody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
EmailBody = Sheet6.Range("b3").Value & vbNewLine & Sheet6.Range("b4").Value & vbNewLine & vbNewLine
EmailBody = EmailBody & Sheet6.Range("b6").Value & vbNewLine & Sheet6.Range("b7").Value & vbNewLine & vbNewLine
For i = 1 To 60
If Sheet6.Range("b8").Offset(i, 0).Value = "" And Sheet6.Range("b8").Offset(i + 1, 0).Value = "" Then GoTo ExitiLoop
EmailBody = EmailBody & Sheet6.Range("b8").Offset(i, 0).Value & vbNewLine
Next i
ExitiLoop:
On Error Resume Next
With OutMail
.to = Sheet6.Range("e6").Value
.Subject = Sheet6.Range("b1").Value
.Body = EmailBody
.display 'Use .Display, .Save, or .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Display More
In the for loop, there are some lines that I would like to appear as bold text in the email. I can detect those lines easily enough; it's formatting them in Outlook that is the challenge. Any suggestions?