I am trying to accomplish this:
I am trying to avoid using RangeToHtml if possible. It seems to copy the range but does not paste it in Outlook. Here is what I have thus far.
Sub Send_Email_Condition_Cell_Value_Change()
Dim pApp As Object
Dim pMail As Object
Dim pBody As String
Dim rng As Range
Set rng = Range("B6:C16")
Set pApp = CreateObject("Outlook.Application")
Set pMail = pApp.CreateItem(0)
On Error Resume Next
With pMail
.To = "@gmail.com"
.CC = ""
.BCC = ""
.Subject = "BLANK Account Action Price Notification"
.Body = "Hello, our recommended action price for BLANK has been hit." & vbNewLine & vbNewLine & _
"Thank you."
.Display
Dim wdDoc As Object '## Word.Document
Dim wdRange As Object '## Word.Range
Set wdDoc = OutMail.GetInspector.WordEditor
Set wdRange = wdDoc.Range(0, 0)
wdRange.InsertAfter vbCrLf & vbCrLf
'Copy the range in-place
rng.Copy
wdRange.Paste
'Below will auto send the email when apostrophe is removed
'.Send
End With
On Error GoTo 0
Set pMail = Nothing
Set pApp = Nothing
End Sub
I have tried utilizing RangeToHtml, but that is a bit complex for my abilities. I have found this solution however I am unable to make it work.