View Single Post
  #2  
Old October 28th 06, 07:39 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to set a long HTMLBody

No, HTMLBody takes a string, which can have embedded carriage returns

MMLMsg.HTMLBody = _
"html" & vbCrLf & _
"body" & vbCrLf & _
"bBold/b text" & vbCrLf & _
"/body" & vbCrLf & _
"/html"

Or, if you have HTML stored in a file, read that file into a string andd
assign it to the HTMLBody property

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"mml" wrote in message
...
Hi,

Thank's for any help.
Here's the point : I have to set an HTML background when opening an
ItemMail
by code.

Her's my code :
CODE
Set MMLMsg = Application.CreateItem(olMailItem)
MMLMsg.BodyFormat = olFormatHTML
MMLMsg.HTMLBody= ?????
/CODE

How to write several lines of HTML code, including CSS style inside my VBA
code ?
Only one line is accepted...
Is it possible to set the content in a variable ?
How to do that ?
Other idea ?....



--
Best regards,

Marc




Ads