Outlook automation formatting text

  • Thread starter Thread starter Giganews
  • Start date Start date
G

Giganews

I am currently working on an Outlook automation module in an Access 97
database. All is working well except now the client wants the generic email
body to contain certain sections in red text and others in blue text. Can
this be done? If so how? I understand that I may have to send this email in
HTML format which is not a problem. Any help would be much appreciated.

Mark
 
Giganews said:
I am currently working on an Outlook automation module in an Access 97
database. All is working well except now the client wants the generic email
body to contain certain sections in red text and others in blue text. Can
this be done? If so how? I understand that I may have to send this email in
HTML format which is not a problem. Any help would be much appreciated.

Mark


Try this
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Send_HTML_email()
Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim myItem As Object
Dim msg As Object

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set myItem = olApp.CreateItem(olMailItem)
Q = Chr(34)
Br = ">"

Email_Body = "Build your HTML code here"
myItem.Display

myItem.To = "your recepient"
myItem.Subject = Date & " " & Time '"HTML test"
myItem.HTMLBody = Email_Body

myItem.Send
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

AvP
 
Barmaley,

Thanks for your reply but I am not sure I understand. Does the Q = Chr(34)
and BR=">" mean something? I have code similar to the below already built
and the process runs fine. I am just not sure were in the Email_Body =
section due I put HTML code to make the text different colors. I am not sure
how to write this. I have always used just plain text as the body during
automation in the past.

Thanks,
Mark
 
Back
Top