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

Hi I wrote a piece of code as an Excel macro that composes an email an
sends it to a person. But I am not sure how I could format my text i
the body of my email:

How can I bold letters,

How can I add bullets etc..



Can someone offer any help?



Thanks

Bhaskaa

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Formatting text with VBA


we're lazy here..

www.rondebruin.nl

no joke he's the resident excel/outlook/email doctor.


if it's not there.. (can't imagine as it's ultra complete)
i think it may be wise to ask in the outlook newsgroup.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


nabhaskaar wrote :

Hi I wrote a piece of code as an Excel macro that composes an email
and sends it to a person. But I am not sure how I could format my
text in the body of my email:

How can I bold letters,

How can I add bullets etc..



Can someone offer any help?



Thanks

Bhaskaar


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting text with VBA

Bhaskaar,

It is possible to add formatting to an email sent by VBA but only i
you're willing to use HTML.

Below is something that I created for use where I work and it work
wonderfully well with Excel97 and Outlook 97/98.

Enjoy,

TheDuck

++++++++++++++++++++++++++++++++++++++++++
Sub MailIt()
Dim App As Object
Dim Itm

Dim mailSubject As String
Dim mailSendTo As String
Dim mailCCTo As String
Dim mailText As String
Dim htmlRed As String

htmlRed = "#FF0000"

Set App = CreateObject("Outlook.Application")
Set Itm = App.createitem(0)

'set subject here or reference the contents of a cell
mailSubject = "This is the subject line"

'specify explicitly or reference a cell. If cell contains a list o
recipents then the list must be delimited correctly as Outlook expect
it to be. Same with the CC list
mailSendTo = Cells(3, 2).Text
mailCCTo = Cells(4, 2).Text

'set the body content of the email specifying all relevant HTM
tags
mailText = "<HTML<Body<PHi,</P" _
& "<PThis is a<B<FONT COLOR=" & Chr(34) & htmlRed
Chr(34) & "" _
& " demonstration</FONT</B of a formatted email usin
red and bold text</P" _
& "<PRegards,</P" _
& "<PTheDuck</P</BODY</HTML"

With Itm
.Subject = mailSubject
.To = mailSendTo
.CC = mailCCTo
.HTMLBody = mailText
'.Display 'this is so the user can see the mail and manuall
hit send
.Send
End With

Set App = Nothing
Set Itm = Nothing
End Su

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting text with VBA

Thanks a lot

--
Message posted from http://www.ExcelForum.com

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
Formatting Text in cells that already have text entered Jennifer V. Excel Worksheet Functions 4 January 13th 09 09:27 PM
copying text within a text box and losing formatting hokiefan1us Excel Discussion (Misc queries) 2 September 17th 08 08:41 PM
Formula Text String: Formatting Text and Numbers? dj479794 Excel Discussion (Misc queries) 5 June 30th 07 12:19 AM
Conditional Formatting based on text within a cell w/ text AND num Shirley Excel Worksheet Functions 2 December 22nd 06 01:40 AM
Conditional Formatting based on Text within Text George Lynch Excel Discussion (Misc queries) 3 May 5th 05 07:58 PM


All times are GMT +1. The time now is 01:36 PM.

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

About Us

"It's about Microsoft Excel"