Amend my VBA code - too add text

Raj1313

Board Regular
Joined
Nov 20, 2014
Messages
125
Hi I have the below code which works fine. I just want to add text before the picture is pasted any ideas?

Sub Email_Report()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object

'Change Range, Addresses and subject below as needed.
MyTo = "test@test.comt"
MySub = "Test"
Range(B81:K161").CopyPicture Appearance:=xlScreen, Format:=xlPicture
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = MyTo
.Subject = MySub
.Text
.Display
.Attachments.Add (ActiveWorkbook.FullName)
SendKeys "^v", True
End With

With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Have you tried using:

Code:
[COLOR=#0000ff]With[/COLOR] OutMail
    .Body = "Some Text goes here"
[COLOR=#0000ff]End With[/COLOR]
 
Upvote 0
Have you tried using:

Code:
[COLOR=#0000ff]With[/COLOR] OutMail
    .Body = "Some Text goes here"
[COLOR=#0000ff]End With[/COLOR]


Thanks guys I sorted it added the text before send keys - so the text went in first the picture was pasted in.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top