Hello all
I hope you can help on this please
This code sends out emails from the contact list which works fine and takes the body of the email content from range G1:G53. What I am trying to do is change the font to Bold from Range G14:G23.
Any ideas please
[Sub Test1()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Dim strbody As String Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
For Each cell In Range("G1:G53")
strbody = strbody & cell.Value & vbNewLine
Next
On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "C").Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = cell.Value
.Subject = "Testing"
.Body = "Attention " & Cells(cell.Row, "A").Value & vbNewLine & vbNewLine & strbody
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub]
I hope you can help on this please
This code sends out emails from the contact list which works fine and takes the body of the email content from range G1:G53. What I am trying to do is change the font to Bold from Range G14:G23.
Any ideas please
[Sub Test1()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Dim strbody As String Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
For Each cell In Range("G1:G53")
strbody = strbody & cell.Value & vbNewLine
Next
On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "C").Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = cell.Value
.Subject = "Testing"
.Body = "Attention " & Cells(cell.Row, "A").Value & vbNewLine & vbNewLine & strbody
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub]