-
HTML Message
I cant seem to get my first line of the message to show:
HTML Code:
MsgGreeting = EmailForm.TextBox2.Value & " " & Recipient '& vbCrLf & vbCrLf
MsgContent = Msg & EmailForm.TextBox3.Text
Set MItem = OutlookApp.CreateItem(olMailItem)
With MItem
.To = EmailAddr
.Subject = Subj
'.Body = Msg
.BodyFormat = 2 'olFormatHTML
.HTMLBody = "<font face='Arial color=red> " & MsgGreeting & " </font>"
.HTMLBody = MItem.HTMLBody & vbCrLf & "<font face='Arial color=blue> " & MsgContent & " </font><br/>"
.Display
SendKeys ("%{s}")
End With
this si not displayed at all
.HTMLBody = "<font face='Arial color=red> " & MsgGreeting & " </font>"
if I comment out the second line
.HTMLBody = MItem.HTMLBody & vbCrLf & "<font face='Arial color=blue> " & MsgContent & " </font><br/>"
then the first line shows up as text literal
-
Re: HTML Message
concatenate all the things in a string variable then use it as a htmlbody, like this
Code:
StrHTML = "<font face='Arial color=red> " & MsgGreeting & " </font>"
StrHTML = StrHTML & MItem.HTMLBody & vbCrLf & "<font face='Arial color=blue> " & MsgContent & " </font><br/>"
.HTMLBody = StrHTML
-
Re: HTML Message
Thanks
Do you need to have the <html> and <Head> tags?
-
Re: HTML Message