Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is there a way to create e-mail messages in Outlook via Excel VBA with formatted (i.e. bold, colored) text. I am currently passing in the string "MailBody" to Outlook using the following code. This code inserts an unformatted text string? Dim OklApp As New Outlook.Application Dim OutLk As Outlook.MailItem Set OutLk = OklApp.CreateItem(olMailItem) OutLk.Body = MailBody Is there any way I can insert formatted text? Thanks, Bill W. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bill
See macro examples on my site http://www.rondebruin.nl/sendmail.htm My Add-in (3.0) is doing this also -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "BillW" wrote in message ... Hi, Is there a way to create e-mail messages in Outlook via Excel VBA with formatted (i.e. bold, colored) text. I am currently passing in the string "MailBody" to Outlook using the following code. This code inserts an unformatted text string? Dim OklApp As New Outlook.Application Dim OutLk As Outlook.MailItem Set OutLk = OklApp.CreateItem(olMailItem) OutLk.Body = MailBody Is there any way I can insert formatted text? Thanks, Bill W. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bill,
If you use the htmlbody property you can insert normal html formatting codes. You need a reference in the project to Outlook. eg. Sub TestEmail() Dim olApp As Outlook.Application Dim olMail As MailItem Set olApp = New Outlook.Application Set olMail = olApp.CreateItem(olMailItem) With olMail .To = " .Subject = "test format" .HTMLBody = "<BHello</B" & chr(34) & "Goodbye" ..Send End With Set olMail = Nothing Set olApp = Nothing End Sub Robin Hammond www.enhanceddatasystems.com "BillW" wrote in message ... Hi, Is there a way to create e-mail messages in Outlook via Excel VBA with formatted (i.e. bold, colored) text. I am currently passing in the string "MailBody" to Outlook using the following code. This code inserts an unformatted text string? Dim OklApp As New Outlook.Application Dim OutLk As Outlook.MailItem Set OutLk = OklApp.CreateItem(olMailItem) OutLk.Body = MailBody Is there any way I can insert formatted text? Thanks, Bill W. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
auto creating an idex sheet when adding formatted sheets | Excel Discussion (Misc queries) | |||
Creating an Outlook Task Item | Excel Discussion (Misc queries) | |||
How can i get formatted data from outlook to excel? | Excel Worksheet Functions | |||
Creating spreadsheet of Outlook emails | Excel Discussion (Misc queries) | |||
Creating properly formatted text file from vbscript using excel data | Excel Programming |