I'm trying to copy and paste a range of cells to Outlook.
What I'm trying to accomplish:
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 = "NAME Account Action Price Notification"
.Body = "Hello, our recommended action price for NAME of PRICE 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
End With
On Error GoTo 0
Set pMail = Nothing
Set pApp = Nothing
End Sub
This code opens the email and populates all of the text needed, but I cannot get it to copy and paste the cells.