Michael0107
New Member
- Joined
- Feb 3, 2016
- Messages
- 15
I am building a Macro to create and send emails with a range that changes for each email address. The body creation and addressing work fine, however, when I use SENDKEYS to paste from the clipboard, the command is ignored. I know that the image is on the clipboard as I can manually paste it into the body, just can't get the macro to complete that step. Here is my code, any assistance is greatly appreciated.
For Each Email In T271
Range("Chart" & x).Select
Selection.copy
If Email.Value Like "?*@?*.?*" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Email.Value
.CC = "jamil_bechara@uhc.com" & ";" & "jonathan_h_allerheiligen@uhc.com"
.Subject = "Weekly Productivity Report"
.Body = "Here is your most recent Productivity Report. " _
& "Any questions please see your supervisor." & vbNewLine
.Display
'SendKeys "^V", True
'.Send
End With
On Error GoTo 0
Set OutMail = Nothing
End If
x = x + 1
For Each Email In T271
Range("Chart" & x).Select
Selection.copy
If Email.Value Like "?*@?*.?*" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Email.Value
.CC = "jamil_bechara@uhc.com" & ";" & "jonathan_h_allerheiligen@uhc.com"
.Subject = "Weekly Productivity Report"
.Body = "Here is your most recent Productivity Report. " _
& "Any questions please see your supervisor." & vbNewLine
.Display
'SendKeys "^V", True
'.Send
End With
On Error GoTo 0
Set OutMail = Nothing
End If
x = x + 1