Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Text Color & bold 1

Status
Not open for further replies.

SWarrior

MIS
Dec 19, 2003
111
US
Ok, everything is now working with my script... Thank you very much guys.. However, NOW they want COLOR so that the failed machines in this LONG report stand out more... (sigh) After I get everything working with PLAIN TEXT, now they want it color.

How can I do this WITHOUT HTML ?? Basically I need to format the color of the text within the array (if possible) I can't find anything on the MS Site, and you guys seem to alway's have the quuickest answers... I'm going to keep looking, but checking back here to see if anyone responds.

Thanks again,
-SWarrior
 
Update...

To make it less confusing... All I need to do is while I am constructing the email, if a certain criteria is TRUE, then the text will be RED, otherwise it will be black... Right now, so far, when it's supposed to be red, in the report, I get "255Bla bla bla" The 255 is a result of vbRed constant. It looks like I'm on the right path, but something's not working properly...

Assistance is greatly appreciated.
-SWarrior
 
Hello SWarrior!

Glad we're able to help with your script. If you're wanting to add color, you may have to bite the bullet and go with the HTML approach. The only other way I can think of is to put your text in word document or spreadsheet and attach that document. However, I think you'll find that HTML really isn't all that bad. Here's an example:
Code:
strHTMLBody = "<TABLE BORDER=0 COLS=1>" & _
			"<TR><TD BGCOLOR=""#C6EFF7"">Heading text</TD></TR>"
				
Do Until aryTest(intCounter) <= ""
	strHTMLBody = strHTMLBody & "<TR><TD><BR></TD></TR>"
	strHTMLBody = strHTMLBody & "<TR><TD BGCOLOR=""#E0E0E0"">Array element " & intCounter & ": " & aryTest(intCounter) & "</TD></TR>"	
	intCounter = intCounter + 1
Loop

strHTMLBody = strHTMLBody & "</TABLE>"
Then be sure to put your HTML code in the correct property:
Code:
objEmail.HTMLBody = strHTMLBody
Good luck!
 
Well, Hopefully THIS makes em happy !! Using the HTML and formating the text with COLOR now, and to line it all up nice and neatly, using a Fixed Font (Courier New) and adding spaces to make even columns in the report.

Like snot said... sometimes ya gotta bite the bullet.

Thanks for ALL your help!
-SWarrior
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top