Okay, well, here's the issue. The email you're creating is in plain text. In order to make it show up in tabular format with bold and such, you're going to need to flip to HTML.
I wouldn't normally loop the way you have, but I know you've already waited a few days for help, so I didn't waste time cleaning that up. Give this a shot:
Code:
Sub Mail()
'Macro Purpose: To send an email through Outlook
Dim objOL As Object
Dim objMail As Object
Dim sEmail As String
Dim sEmailColumn As String
Dim sSubject As String
Dim sBody As String
Dim lDataRow As Long
Dim cl As Range
'Set column with email address
sEmailColumn = "J"
For Each cl In Selection.Resize(, 1)
'Generate required info
lDataRow = cl.Row
'Check if Mail
If cl.Parent.Range("D" & lDataRow).Value = "Greetings" Then
With cl.Parent
sEmail = .Range(sEmailColumn & lDataRow)
sSubject = "JOB ID " & .Range("B" & lDataRow)
sBody = "<p>Greetings " & .Range("A" & lDataRow).Value & ",</p>" & _
"<p>I am contacting you regarding the missing " & _
"information/documents of this client. Request you to provide the same.</p>" & _
"<table>" & _
"<tr><td>Job ID :-</td><td>" & .Range("E" & lDataRow) & "</td></tr>" & _
"<tr><td><b><u>Required Information</u></b> :-</td></tr>" & _
"<tr><td><b>Client/Information/Year</b> : </td>" & _
"<td>" & .Range("F" & lDataRow) & " " & .Range("G" & lDataRow) & " for the year " & .Range("H" & lDataRow) & "</td></tr>" & _
"<tr><td>Comments : </td><td>" & .Range("I" & lDataRow) & "</td></tr>" & _
"<tr>: 2 Copies</tr>" & _
"</table>"
End With
'Turn on error handling
On Error GoTo Cleanup
'Bind to Outlook
Set objOL = CreateObject("Outlook.Application")
'Create a new email and send it
Set objMail = objOL.CreateItem(0) '0=olmailitem
With objMail
.To = sEmail
.Subject = sSubject
.htmlBody = sBody
.Display
End With
End If
Next cl
Cleanup:
'Release all objects
Set objMail = Nothing
Set objOL = Nothing
On Error GoTo 0
End Sub
It's not going to be perfect yet, I'm sure, but it should get you started.
Bookmarks