Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Email Formatting

I was wanting to add some bold highlighting to the body of an e-mail that I'm
automatically generating with this bit of code. Now I know that there is no
way to do formatting within the strbody, as it is just a string of text.
However is there some way to do that if I were to put the text into the .Body
= Spot??? Specifically I want the CURmonth to be bolded within the body,
what might that look like? Thanks!!!!

Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

CURmonth = CStr(MonthName(Month(Now) - 1))
strbody = "Text " & CURmonth & "Text"
On Error Resume Next
With OutMail
.To = e-mail address
.CC = ""
.BCC = ""
.Subject = "TEXT"
.Body = strbody
.Attachments.Add ("FILENAME")
.Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Email Formatting

Try .HTMLBody instead of .Body

Then use HTML coding to bold the desired text.
Example: The following word <b is </b in bold.

Good Luck.

"bodhisatvaofboogie" wrote:

I was wanting to add some bold highlighting to the body of an e-mail that I'm
automatically generating with this bit of code. Now I know that there is no
way to do formatting within the strbody, as it is just a string of text.
However is there some way to do that if I were to put the text into the .Body
= Spot??? Specifically I want the CURmonth to be bolded within the body,
what might that look like? Thanks!!!!

Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

CURmonth = CStr(MonthName(Month(Now) - 1))
strbody = "Text " & CURmonth & "Text"
On Error Resume Next
With OutMail
.To = e-mail address
.CC = ""
.BCC = ""
.Subject = "TEXT"
.Body = strbody
.Attachments.Add ("FILENAME")
.Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with formatting / saving before I email my worksheet ExcelUser Excel Discussion (Misc queries) 9 July 15th 09 09:16 PM
Validating email address formatting BethP Excel Worksheet Functions 5 November 16th 06 11:05 AM
How do I disable email formatting. dwilliams Excel Discussion (Misc queries) 6 February 8th 06 06:47 PM
Formatting email and web addresses in Excel JohnnyJomp New Users to Excel 5 January 31st 06 04:43 PM
formatting email from excel to outlook John Tenit Excel Programming 0 May 25th 04 08:16 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"