×
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!
  • Students Click Here

*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.

Students Click Here

Jobs

How can I format a bookmark?

How can I format a bookmark?

How can I format a bookmark?

(OP)
Hi there,

I fill a word document from a ms access vba code module using bookmarks.
Now I want some bookmarks to be represented in a color, say green.
I fill the bookmark:
doc.Bookmarks("b1718_1").Range.Text = doc.Bookmarks("b1718_1").Range.Text = Format(rs!mv5_1_10p, "0.0")
This works.
Then I tried:
doc.Bookmarks("b1718_1").Range.HighlightColorIndex = wdBrightGreen
This works, but it makes the whole bookmark green. So the value is put in a green square.
But what I want is the value itself, which is a figure, in green.
I did some research on the internet and found that the following code should work:
doc.Bookmarks("b1718_1").Range.Text = doc.Bookmarks("b1718_1").Range.Text = Format(rs!mv5_1_10p, "0.0")
doc.Bookmarks("b1718_1").Range.Font.ColorIndex = wdBrightGreen
The code compiles, but the value still had forecolor black...

Does anyone know what might help? Any help will be greatly appreciated, thanx

RE: How can I format a bookmark?

(OP)
This worked! Apparently the tric was to select the bookmark before manipulating it's font.
Thanx very much!

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!

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