473,506 Members | 17,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outlook automation formatting text

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
Nov 13 '05 #1
2 2183

"Giganews" <he******@yahoo.com> wrote in message
news:oq********************@comcast.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
Nov 13 '05 #2
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" <so*****@nowhere.com> wrote in message
news:d4**********@cnss.gov.ab.ca...

"Giganews" <he******@yahoo.com> wrote in message
news:oq********************@comcast.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

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5395
by: MLH | last post by:
Is the following remotely correct? =DDE("C:\Program Files\Program Files\Outlook Express\OEmig50","Attachment","Name") I'm not sure that OEmig50.exe is the executable for OE. Anybody know? ...
5
1964
by: Greg Robinson | last post by:
Not sure where to post this. At runtime, we need to be able to make sure a user is running Outlook (at least 98 or higher) in order to send an email. So, if a condition is met, we need to...
26
4462
by: Tom Becker | last post by:
Is there a way, from Access, to programmatically click the Send and Receive button in Outlook?
7
5031
by: Dmitry Akselrod | last post by:
Hello everyone, I am attempting to extract some header information from typical Microsoft Outlook MSG files in VB.NET. I am not after a complete message or attachments that may be enclosed. I...
4
14569
by: SStory | last post by:
I want to drag a message from Outlook to a richtextbox on a vb.net form. I don't get the message body. I have searched all over the place and found nothing. Does anyone know how to do this? I...
3
10640
by: Jeff | last post by:
I am trying to send emails from my application (not using a plugin, that will come later), I can create an email and add attachments. I can fill in the body etc. Word works for the editor. So...
1
3208
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox...
0
2091
by: RodneyAnonymous | last post by:
I need to be able to put the contents of a RichTextBox, including formatting and images, into a new Outlook e-mail. So far, the results I have are either that I lose all formatting and keep only the...
0
1580
by: madihamir | last post by:
Iam new to .net and have gotten assignment for make the class library to automate the outlook I have tried to done it but i've to make the Handlers also . Detecting an methods for receiving and...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.