K
kevinho
I am using the below code to send an email based on cell data. however,
I would like to include a url to a directory (eg
\\server\directory\etc.) within the body of the email. Everything I
try is coming out as plain text even though Outlook is set to send as
HTML...
The Outlook 11.0 Object Library is included in "Tools:References"
Sub Send_Msg()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
..To = Sheets("Order").Range("G35").Value
..Subject = Sheets("Order").Range("f3").Value & " " &
Sheets("Job").Range("E6").Value
..Body = "Dear " & Sheets("Job").Range("B8").Value & _
"," & Chr(13) & Chr(13) & "Your production job for " &
Sheets("Job").Range("E6").Value & " for customer: " &
Sheets("Job").Range("I6").Value & " is in progress. " & _
"Your Spec Number is: " & _
Format(Sheets("Order").Range("f3").Value) & "." & Chr(13) &
Chr(13) & "Regards"
..Display
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub
Cheers
Kev
I would like to include a url to a directory (eg
\\server\directory\etc.) within the body of the email. Everything I
try is coming out as plain text even though Outlook is set to send as
HTML...
The Outlook 11.0 Object Library is included in "Tools:References"
Sub Send_Msg()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
..To = Sheets("Order").Range("G35").Value
..Subject = Sheets("Order").Range("f3").Value & " " &
Sheets("Job").Range("E6").Value
..Body = "Dear " & Sheets("Job").Range("B8").Value & _
"," & Chr(13) & Chr(13) & "Your production job for " &
Sheets("Job").Range("E6").Value & " for customer: " &
Sheets("Job").Range("I6").Value & " is in progress. " & _
"Your Spec Number is: " & _
Format(Sheets("Order").Range("f3").Value) & "." & Chr(13) &
Chr(13) & "Regards"
..Display
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub
Cheers
Kev