jakeman
Active Member
- Joined
- Apr 29, 2008
- Messages
- 325
- Office Version
- 365
- Platform
- Windows
I am trying to write some VBA code that will create an Outlook email for me with a generic message in the body. I don't know how to create blank rows in the body so that I can include a closing.
The code I have so far looks like this:
Thanks.
Jake
The code I have so far looks like this:
Code:
Sub Adherence_email_MHA()
Dim myOutlook As Object
Dim myMailItem As Object
Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(olMailItem)
With otlNewMail
.To = "_MHAManagement"
.Subject = "Adherence updated"
.body = "sentence 1" ****here I'd like to put a blank line after this sentence
.body = "sentence 2" **** this would be the closing
'.Attachments.Add
.Display
End With
Set otlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
End Sub
Jake