CURSUR ON TOP OF IMAGE

annadinesh

Board Regular
Joined
Mar 1, 2017
Messages
128
Office Version
  1. 2019
Platform
  1. Windows
Dear Expert
Please help

in the below VBA Code I want the following to be input after the image copies to Email Body

"Regards
Dinesh Saha
Durga Hyundai

and the Text cursur should be on the Top of Image


Private Sub CommandButton2_Click()

If ActiveSheet.Name = "EW" Then

If IsEmpty(Worksheets("EW").Range("Y1")) Then
Cancel = True
MsgBox ("Email ID Blank"), vbDefaultButton1, "E Mail"

Else

If IsEmpty(Worksheets("EW").Range("D5")) Then
Cancel = True

MsgBox ("Please Select Vehicle Model"), vbDefaultButton1, "Vehicle Model Blank"
Range("D5").Activate

Else

Dim Outlook As Object
Dim email As Object
Dim xInspect As Object
Dim pageEditor As Object
Dim assunto As String, para As String
Dim myRange As Excel.Range


Set Outlook = CreateObject("Outlook.application")
Set email = Outlook.CreateItem(0)

With email
.Subject = "Hyundai Extended Warranty & RSA Quotation"
.To = Range("Y1").Value
.Display
Set xInspect = email.GetInspector
Set pageEditor = xInspect.WordEditor

pageEditor.Range.Characters(1).Select
With pageEditor.Application.Selection
.Collapse 1 ' 1 = wdCollapseStart
.InsertAfter "Dear Hyundai Customer," & vbCrLf & vbCrLf & _
"here's the info:" & vbCrLf & vbCrLf
.Collapse 0 ' 0 = wdCollapseEnd
For Each myRange In Sheets("EW") _
.Range("B2:K47").Areas
myRange.CopyPicture Appearance:=xlScreen, Format:=xlBitmap

'.PasteAndFormat Type:=13 ' 13 = wdChartPicture
.PasteSpecial DataType:=4 ' 4 = wdPasteBitmap
.Collapse 0

Next myRange


End With
.Display

Set pageEditor = Nothing
Set xInspect = Nothing

End With
Set email = Nothing
Set Outlook = Nothing
End If
End If
End If
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

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