Hi
I'm trying to send a chunk of information from named ranges in my spreadsheet in the body of my auto email.
When I step through the code there seem to be a few issues that I can't seem to figure out. The first occurs in the body section 'Invalid use of property' when it gets to Range("JobName"). Another error occurs on the line with "Results: ", error is 'Expected: line number or label statement or end of statement'.
I've googled my heart out trying to solve this myself but not getting anywhere fast! Any advice would be appreciated.
Thanks
Jo
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "jrussell3@placemakers.co.nz" 'Change to Willie when tested (Despatch)
.CC = ""
.BCC = ""
.Subject = "Delivery Site Specific Hazard Analysis: " & Range("AccountCode") & " " & Range("Customer") & " - " & Range("JobName") & ", " & Range("Address1") & ", " & Range("Address2")
.Body = "Job:" & vbNewLine_
Range ("Customer") & ", " & Range("JobName") & vbNewLine_
Range("Address1) & ", " & Range("Address2") & ", " &Range("Address3") & vbNewLine & vbNewLine_
"Results:" & vbnewline & _
"Overhead Cable, Buildings or Foliage: " & Sheets("Ref").Range("overhead") & vbnewline & _
"Narrow Driveway: " & Sheets("Ref").Range("driveway")
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
Bookmarks