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!

Rich text Highlight with back color? 1

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,207
US
I will admit I have not had the need to dive into rich text...

Hopefully what I am looking to do can be done. I have seen the example to highlight the font color but I want to actually highlight or set the back color. The below literal snippet is shows how I am setting the unbound control on a report. It is much more involved than that and my bold HTML tags in the same control are working. Any thoughts? I suspect it has something to do without using a full HTML document but which parts and how much of what is required would be the question. In case it matters, I also embed Vertical tabs with CHR(11) in the string that is assigned to the unbound report control. I am using Access 2010 for this.

Code:
"Leading text <span style=""background-color:yellow;"">Some Text</span> Trailing text"

 
Any chance you can rewrite the question? I cannot interpret what you are asking
 
with the below function I can pass in any string of text and then show it in yellow hilite in a richtext box. Not sure if that is what you are asking.

Code:
Private Sub cmdYellow_Click()
  Me.txtColored = MakeYellow(Me.txtEnter)
End Sub

Public Function MakeYellow(TextToColor As String) As String
  'Sets background shading yellow
  MakeYellow = "<div><font style='BACKGROUND-COLOR:#FFFF00'>" & TextToColor & "</font></div>"
End Function
 
Yes. I did manage to figure it out... Wrap each paragraph in a div and use the font tag instead of the span to wrap the text. Caveat it is a HTML doc so embedding vertical tabs, chr(11), or other whitespace will not work, look up the html equivalents. Sorry in the delay, the proxy ate my login ability.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top