Hi Folks,
I have a bit of a problem trying to get an Excell Macro to separate lines when launching an email in Outlook. To be more specific, I have created a VBA userform which one can fill out then send to MS Outlook by clicking on a Command Button. I have created it because the email to fax service is confusing to use. I have created several TextBoxes to separate the infomation needed for a proper cover sheet. When the command button is hit, it sends the information filled out in the text boxes to the body of the email. The problem is that it reads as a solid line. For example:
"To: John Doe From: Tazyote # of Pages: 4 Comments: Here is that report you asked for. Let me know if I can help you out. Thanks"
I would like to have the macro automatically {Enter} after each line so that the body of the email looks like this:
To: John Doe
From: Tazyote
# of Pages: 4
Comments: Here is that report you asked for. Let me know if I can help you out. Thanks
I have been unable to figure out how to do this. Here is the macro I am using so far:
Private Sub CommandButton2_Click()
Dim oOLook As Object
Dim oEMail As Object
'
Set oOLook = CreateObject("Outlook.Application")
oOLook.Session.Logon
Set oEMail = oOLook.CreateItem(0)
oEMail.Display
'
On Error Resume Next
With oEMail
.To = "1" & TextBox1.Value & TextBox2.Value & TextBox3.Value & "@faxingmail.com"
.CC = ""
.BCC = ""
.Body = "To: " & TextBox5.Value & " From: " & TextBox6.Value & " # of Pages: " & TextBox7.Value & " Comments: " & TextBox8.Value
.Subject = TextBox4.Value
' .Send
End With
On Error GoTo 0
End Sub
Any ideas on how to do this? I have attached a screen shot of the UserForm so everyone can visualize what I am talking about. Thanks
Bookmarks