Code:
Sub Macro1()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi" & vbNewLine & vbNewLine & _
"This email has been sent as notification that we are required to comply with regulations for the " & Range("arrangement").Value & " arrangement within 5 days of this email" & vbNewLine & _
"Relevant Date: " & Format(Range("H28").Value, "dddd dd mmmm yyyy ") & vbNewLine & _
"" & vbNewLine & _
"Deadline to advise Users: " & Format(Range("H30").Value, "dddd dd mmmm yyyy ") & vbNewLine & _
Range("arrangement").Value
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "requirement triggered"
.Body = strbody
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Hi
I have created the above macro which I imagine is fairly common as I took it from a website (I think Ron de Bruin).
I added in the Range("arrangement").Value part so that the macro will inclue the text from the cell I have named 'arrangement'.
It all works very well, however, what I would like to do is to be able to adjust the font for different parts of the text. Especially the date:
Code:
& Format(Range("H30").Value, "dddd dd mmmm yyyy ") & vbNewLine & _
I have looked at code such as font.bold = true or Selection.font.bold = true but I can't get them to fit in anywhere that works, I think because of the .Value part.
Is there a simple way to modify the macro so I can make the changes?
If so... can I also ask how to include 'tab spaces' in the macro, so when viewing the email, certain text is aligned.
Thanks
Dan