VBA Code:
Sub CreateMail()
Call spcheck2
Dim objOutlook As Object
Dim objMail As Object
Dim rngTo As Range
Dim rngBody As Range
Dim outMail As Outlook.MailItem.Reply 'new
Email = Worksheets("Email List").Range("B2")
EmailCC = Worksheets("Email List").Range("B8")
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
Set outMail = objOutlook.CreateItem(olMailItem)
With Sheets("Report")
Set rngBody = .Range("A1:G20")
End With
rngBody.Copy
With objMail
.To = Email
.CC = EmailCC
.Subject = Range("D1") & " " & "EOS" & " Brazing Lead Report " & Range("B1").Value [COLOR=rgb(184, 49, 47)]Need the code to find EOS in outlook and reply all from previous email[/COLOR]
.Display
'outMail.Display
Dim wordDoc As Word.Document
Set wordDoc = .GetInspector.WordEditor ' or use outMail instead of with()
wordDoc.Range.PasteandFormat wdChartPicture
For Each shp In wordDoc.InlineShapes
shp.ScaleHeight = 95
shp.ScaleWidth = 105
Next
End With
'SendKeys "^({v})", True
On Error GoTo 0
Set outMail = Nothing
Set OutApp = Nothing
End Sub
Last edited by a moderator: