dbTalk Databases Forums  

Outlook automation formatting text

comp.database.ms-access comp.database.ms-access


Discuss Outlook automation formatting text in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Giganews
 
Posts: n/a

Default Outlook automation formatting text - 04-29-2005 , 10:25 AM






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



Reply With Quote
  #2  
Old   
Barmaley
 
Posts: n/a

Default Re: Outlook automation formatting text - 04-29-2005 , 12:15 PM







"Giganews" <hereinde (AT) yahoo (DOT) com> wrote

Quote:
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




Reply With Quote
  #3  
Old   
Giganews
 
Posts: n/a

Default Re: Outlook automation formatting text - 04-29-2005 , 08:39 PM



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




"Barmaley" <someone (AT) nowhere (DOT) com> wrote

Quote:
"Giganews" <hereinde (AT) yahoo (DOT) com> wrote in message
newsqCdnSXym5lzzO_fRVn-pw (AT) comcast (DOT) com...
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





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.