formatting text email

gilberto

Registered User.
Local time
Today, 12:05
Joined
Apr 4, 2002
Messages
29
Hi all

This should be trivial, but I don't know how to do it, and I couldn't find it in the Forums. Many thanks in advance for helping me!!!

1) I need to format text in my email (size, colour).

2) I need to format a number, contained in an integer variable. adding zeros on its left side (e.g., 004)

This is the code I'm using (which is working fine) for sending the text contained in StrBody.
StrBody should contain the formatted text.

(My Outlook is set for sending RTF emails.)

Public Sub SendEmail(StrSubject As String, StrBody As String, StrTo As String)

Dim NameSpace As Object
Dim EmailSend As Outlook.MailItem
Dim EmailApp As Object

Set EmailApp = CreateObject("Outlook.Application") 'using the outlook object
Set NameSpace = EmailApp.GetNamespace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)

EmailSend.Subject = StrSubject
EmailSend.Body = StrBody

EmailSend.Recipients.Add (StrTo) 'add the recipient
EmailSend.Display 'display the email

Set EmailApp = Nothing
Set EmailSend = Nothing
End Sub
 
many thanks for your help, Fizzio! I'll try it.
 
Last edited:
hi there

I think I'm too ignorant for understanding the file...

I tried this (for writing "Dear" in bold):

t1 = {\b, "Dear "}
Call SendEmail(t1, Me.[E-mail])

but of course the compiler doesn't accept it. Am I in the right direction, at least?

Many thanks in advance for the help.
 
hi Pat

This was very clever - I couldn't have discovered alone, for sure!

Many, many thanks - it's working fine now!
 

Users who are viewing this thread

Back
Top Bottom