ed.ayers315
Board Regular
- Joined
- Dec 14, 2009
- Messages
- 166
Here is my code. I put this together via other posts I found in this forum; nothing did exactly what I needed as written.
Everything works the way I intend; the problem is the range I copy will not paste into the body of email.
How can i get this to work?
Appreciate any help or advice!
Everything works the way I intend; the problem is the range I copy will not paste into the body of email.
How can i get this to work?
Appreciate any help or advice!
Code:
Public Sub Copy_and_Paste_Cells_To_Email_Body_LB()
Dim OutApp As Object 'Outlook.Application
Dim wDocument As Object 'Word.Document
Dim wSelection As Object 'Word.Selection
Dim oApp As Object
Dim oMail As Object
Dim WB As Workbook
Dim FileName As String
Dim wSht As Worksheet
Dim shtName As String
Dim ThisFile As String
Dim oByValue
ThisFile = "C:\Users\My\Desktop\Report.pdf"
Application.ScreenUpdating = True
'Create and show the Outlook mail item
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(0)
With oMail
.To = "ed.ayers315@hotmail.com"
.CC = ""
.BCC = ""
.Subject = "UF Log Exception reporting"
Set wkb = ActiveWorkbook
Set wks = wkb.ActiveSheet
Set OutApp = CreateObject("Outlook.Application")
Set wkb = ActiveWorkbook
Set wks = wkb.ActiveSheet
Range("Q4").Select
Selection.End(xlDown).Select
Range("A1:Q7").Select
Range("Q6").Activate
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
.display
.send
Application.CutCopyMode = False
End With
End Sub
Last edited by a moderator: