Outlook email url in body

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

Ivan F Moala

Try

..HTMLBody = "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"
 
K

kevinho

Brilliant, I knew it would be something simple...!

Now the only thing I need to do is change the Chr(13) bits to <br
tags, cos they no longer work.

Cheers

Kev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top