Good evening,
I've gotten some great help with all my questions about sending e-mail from excel. I have one additional question, I would like the body of my email to be taken from a word document. (the big reason for this is that the email must be formatted to include a picture). Is this possible? I'd need to insert the information from the word document then some additional data from my excel workhseet.
here is the code I am using to send the email:
Thanks in advance for all your help,
Sam
I've gotten some great help with all my questions about sending e-mail from excel. I have one additional question, I would like the body of my email to be taken from a word document. (the big reason for this is that the email must be formatted to include a picture). Is this possible? I'd need to insert the information from the word document then some additional data from my excel workhseet.
here is the code I am using to send the email:
Rich (BB code):
Sub SendEmail2_Click()
'Create variables
Dim OutApp As Object
Dim OutMail As Object
Dim AW As Worksheet
Dim i As Integer
Dim Greeting As String
Dim Greeting1 As String
Dim Subject As String
Set AW = ActiveSheet
On Error GoTo cleanup
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Do
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
'Create email
Subject = "Perfect 10"
Greeting1 = "Dear" & "" & AW.Range("B" & i).Value
With OutMail
.To = AW.Range("C" & i).Value
.Subject = Subject
.Body = I'd like the stuff from word here then this
"<a href=""" & AW.Range("F" & i).Value & """>Click here</a>" & _
vbNewLine
'Send the e-mail
.Send
End With
i = i + 1
Loop Until IsEmpty(Cells(i, 1))
On Error GoTo 0
Set OutMail = Nothing
AW.AutoFilterMode = False
cleanup:
Set OutApp = Nothing
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Thanks in advance for all your help,
Sam