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