+ Reply to Thread
Results 1 to 3 of 3

Outlook email url in body

  1. #1
    Registered User
    Join Date
    07-07-2005
    Posts
    6

    Question Outlook email url in body

    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

  2. #2
    Registered User Ivan F Moala's Avatar
    Join Date
    10-25-2003
    Location
    Auckland, New Zealand
    Posts
    71
    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"
    Kind Regards,
    Ivan F Moala From the City of Sails
    \1

  3. #3
    Registered User
    Join Date
    07-07-2005
    Posts
    6
    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

    Quote Originally Posted by 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"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1