Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to enable HTML processing in Outlook 1

Status
Not open for further replies.

acnovice

Programmer
Jan 27, 2005
100
US
Hi,

I'm sending e-mail from access db.
I have to use HTML code in my Outlook form such as bold type, center adjust the text ...

Does anyone know how to enable HTML processing in email from access form ?

Example)
strBody = "<Center><B>This line for Center and Bold Text</B></Center>"

Thank you.
 
USe the HTMLBody property of the MailItem object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,

I'm sorry bug you again.
Can you give a specific example ? How to use it.
I have no idea how to use HTMLBody property of the MailItem object.

Appreciate it.
 
Code:
Sub OutlookHTML()
  Dim olapp As Outlook.Application
  Dim olmail As Outlook.MailItem
  Dim strBodyText As String

  Set olapp = New Outlook.Application
  Set olmail = olapp.CreateItem(olmailitem)
  
  strBodyText = "<H4>Hello World</H4>"
  
  With olmail
    .To = "jughead@archie.org"
    .Subject = "Read This"
    .HTMLBody = strBodyText 
    .Send
  End With    
End Sub

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Hi,

VBslammer, your code works great.

However, if I add line to strBodyText = "<U>Product Type:</U>", the first line "Hello World" doesn't show up.

Can I add more than one line and how ?

Thank you.

 
strBodyText = strBodyText & "<BR><U>Product Type:</U>"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

Oh, I forgot to do that.... thank you PHV.

Have a good day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top