Hello fellow Forum'ers
I have been trying for hours now pulling my hair out trying to understand why my code will not put a line break in my email. In basic terms I have a table which contains a field with the body for an email which can be amended by the end user through a form. It enables the end user to personalise the bulk of their messages rather than me programming a set message. With a click of a button on a form an email is sent to that customer. I have DLOOKUP successfully pulling through the email body, HOWEVER I cant get the bugger to put a line break between "Dear X" and "I have tried......"
This is my code, please help!
I have been trying for hours now pulling my hair out trying to understand why my code will not put a line break in my email. In basic terms I have a table which contains a field with the body for an email which can be amended by the end user through a form. It enables the end user to personalise the bulk of their messages rather than me programming a set message. With a click of a button on a form an email is sent to that customer. I have DLOOKUP successfully pulling through the email body, HOWEVER I cant get the bugger to put a line break between "Dear X" and "I have tried......"
This is my code, please help!
Code:
Private Sub Command16_Click()
Dim MsgBody As String
Dim Msg As String
MsgBody = DLookup("AutomatedMessageEmail", "AutomatedMessageT", "AutomatedMessageID=1")
Msg = "Dear " & Client_FN & ", <p>" & MsgBody
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
.To = Email_Address
.BCC = "test@test.com"
.Subject = "Mortgage Enquiry"
.Display
.HTMLBody = Msg & .HTMLBody
End With
Set M = Nothing
Set O = Nothing
End Sub