Good day all, first I want to apologize for raising a question for something that has obviously been discussed many times, I am just having real trouble understanding the responses and I am desperate for someone to help me out.
I have the below code written, it has worked for me for all of my previous needs of sending simple emails, but now that I want to have the email body with the range of cells added formatted (color and borders) I am not able to get it to work at all.
I did my best to study the answers that were there before, and play with the codes to adjust it to my needs, but I am truly lost.
The code below is what I use, can someone please help me adjust it so that the range I am relating to will appear in the email body with it's formats?
Thank you very much in advance, I really pray for some good help!
Sub SendEmail()
Dim TodayDate As Date
Dim x As Integer, A As Integer
Dim UserName As String
Dim MailDbName As String, msgboxtitle As String
Dim Recipient As Variant
Dim Maildb As Object
Dim MailDoc As Object
Dim AttachME As Object
Dim Session As Object
Dim stSignature As String
Dim Sent As String, EmailTo As String
Dim RecipientEmail As String, Subject As String
Dim rng As range
RecipientEmail = Worksheets("Email").range("B1").Value
EmailTo = Worksheets("Email").range("C3").Value
Subject = Worksheets("Email").range("B2").Value
Set rng = Worksheets("Email").range("B3:C10")
' Open and locate current LOTUS NOTES User
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDatabase("", MailDbName)
If Maildb.IsOpen = True Then
Else
Maildb.OPENMAIL
End If
' Create New Mail and Address Title Handlers
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
' Select range of e-mail addresses
MailDoc.SendTo = RecipientEmail
MailDoc.Subject = Subject
MailDoc.body = rng
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now()
On Error GoTo errorhandler1
MailDoc.Send 0, RecipientEmail
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
errorhandler1:
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
End Sub