Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   How to set a long HTMLBody (http://www.outlookbanter.com/outlook-vba/31332-how-set-long-htmlbody.html)

mml October 28th 06 06:07 PM

How to set a long HTMLBody
 
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



Dmitry Streblechenko October 28th 06 07:39 PM

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






All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com