Willsy3369
New Member
- Joined
- Aug 3, 2022
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
Below is a code that I am using to send via email. To use you have to have the Outlook app open. Currently this has been working a treat, but now I'm getting a "Run-time error '5': Invalid procedure call or argument. When I debug "send" in the code is highlighted. Can someone help.
Sub CopyRngToOutlook1()
Dim doc As Object, rng As Range
msg = Range("B14")
Location = Range("E14")
Set rng = Sheets("Locksmith").Range("D3:L33")
With CreateObject("Outlook.Application").CreateItem(0)
Set doc = .GetInspector.WordEditor
rng.CopyPicture
doc.Range(0, 0).Paste
'.To = "ian.wills@justice.vic.gov.au"
'.CC = ""
.Subject = "Lock & Key Fault - MRC - D10"
'.Display
.send
MsgBox "Thank you, an email has been sent to" & vbNewLine & "DJCS-CV-LOCKSMITH SERVICES!", vbInformation
Sub CopyRngToOutlook1()
Dim doc As Object, rng As Range
msg = Range("B14")
Location = Range("E14")
Set rng = Sheets("Locksmith").Range("D3:L33")
With CreateObject("Outlook.Application").CreateItem(0)
Set doc = .GetInspector.WordEditor
rng.CopyPicture
doc.Range(0, 0).Paste
'.To = "ian.wills@justice.vic.gov.au"
'.CC = ""
.Subject = "Lock & Key Fault - MRC - D10"
'.Display
.send
MsgBox "Thank you, an email has been sent to" & vbNewLine & "DJCS-CV-LOCKSMITH SERVICES!", vbInformation