INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Rich text Highlight with back color?

Rich text Highlight with back color?

(OP)
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" 

RE: Rich text Highlight with back color?

Any chance you can rewrite the question? I cannot interpret what you are asking

RE: Rich text Highlight with back color?

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 

RE: Rich text Highlight with back color?

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close