how to send a html message from excel

  • Thread starter Thread starter Bruce
  • Start date Start date
B

Bruce

I am trying to create a HTML email. When I do it, all of the strings are
trunicated to only include what is showing in the worksheet. If a cell is
narrower then the line of text, it only includes that parts that are
showing.


Here is the code I use to build the message:

Set rng = Sheets("Marketing-letter").Range("A1:A28")


For Each oAccount In OutApp.Session.Accounts
If oAccount.AccountType = olPop3 Then
If oAccount.DisplayName = "(e-mail address removed)" Then
MsgBox "Sending out!"


Dim oMail As Outlook.MailItem
Set oMail = OutApp.CreateItem(olMailItem)
oMail.To = emailname
oMail.CC = ""
oMail.BCC = bbcname
oMail.Subject = "my subject"
oMail.Recipients.ResolveAll
oMail.HTMLBody = RangetoHTML(rng) '& vbNewLine & vbNewLine &
signature
oMail.Attachments.Add ("C:\notary\myattachment.pdf")
oMail.SendUsingAccount = oAccount
oMail.Send

Sheets("Marketing").Select
Range("L" & rowi).Select
ActiveCell.FormulaR1C1 = ActiveCell.FormulaR1C1 & " Sent: " &
Format(Now, "mmm-d-yyyy hh:mm")



'Range("BR29").Select
'.temp_.Select



End If

End If
Next
 
Back
Top