Tricky: Word Table Conditional Formatting
You'll need to retrieve the value first -- VBA doesn't know what
'GrandTotal' refers to.
Dim pValue as double
Dim pBookmark as string
pValue = ActiveDocument.Bookmarks("GrandTotal").Range
Select case pValue
Case Is 1
pBookmark = "Fair"
:
End Select
With ActiveDocument.Bookmarks(pBookmark).Range
.Bold = True
.BackgroundPatternColor = wdColorBlue
End with
"TomorrowsMan" wrote in message
ups.com...
Sorry you have been having to lead me by the hand through this; I'm
just discovering how versatile VBA is when making user forms, and I'm
not versed in the language yet.
So, if I take a stab at it.....I would have:
Sub FieldHighlight()
Select case GrandTotal
Case Is 1
ActiveDocument.Bookmarks("Fair").Range.Bold = TRUE
ActiveDocument.Bookmarks("Fair").Range.BackgroundP atternColor =
wdColorBlue
Case Is 2
ActiveDocument.Bookmarks("Good").Range.Bold = TRUE
ActiveDocument.Bookmarks("Good").Range.BackgroundP atternColor =
wdColorBlue
Case Is 3
ActiveDocument.Bookmarks("Great").Range.Bold = TRUE
ActiveDocument.Bookmarks("Great").Range.Background PatternColor =
wdColorBlue
Case Is 4
ActiveDocument.Bookmarks("Excellent").Range.Bold = TRUE
ActiveDocument.Bookmarks("Excellent").Range.Backgr oundPatternColor =
wdColorBlue
End Sub
Is that close? Or am I missing a line selecting the GrandTotal
bookmark?
Thanks again a million times....I'm learning alot, but there's a lot to
learn. :-)
Chris
|