Word 2002: What can take backgroundpatterncolor?

  • Thread starter jojo the clownfaced warthog
  • Start date
J

jojo the clownfaced warthog

All/Any:

Help! This is making me crazy…

I've got text above a table and text below it. I manually highlight
(selecting, then using the "Shading Color" button) the text and the table.
Instead of the table cells filling with color, the text takes the background
color.

I then search for any occurrence of BackgroundPatternColor in:
+ selection.range
+ selection.formattedtext
+ selection.paragraphs

None of these seem to be it. What am I missing? Or is this a bug
somewhere? (search code below)

Thanks!

-Jon


code:

Sub amItable()
With Selection
.HomeKey unit:=wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Format = False
.Text = ""
.Replacement.Text = ""
.Highlight = False

While .Execute(replace:=wdReplaceNone)

If Selection.Information(wdWithInTable) = True Then
MsgBox "I'm in a table!"
If Selection.Cells(1).Shading.BackgroundPatternColor <> _
wdColorAutomatic Then
MsgBox "I'm shaded in a table"
ElseIf Selection.Characters(1).Shading.BackgroundPatternColor <> _
wdColorAutomatic Then
MsgBox "I'm a shaded character in a table!"
ElseIf Selection.Paragraphs(1).Shading.BackgroundPatternColor <> _
wdColorAutomatic Then
MsgBox "I'm a shaded paragraph in a table!"
ElseIf Selection.Range.Shading.BackgroundPatternColor <> _
wdColorAutomatic Then
MsgBox "I'm a shaded range in a table!"
ElseIf Selection.Rows(1).Shading.BackgroundPatternColor <> _
wdColorAutomatic Then
MsgBox "I'm a shaded row in a table!"
ElseIf Selection.Shading.BackgroundPatternColor <> _
wdColorAutomatic Then
MsgBox "I'm a selection shading in a table"
End If

End If
Wend
End With
End With
 
J

jojo the clownfaced warthog

I've got text above a table and text below it. I manually highlight
(selecting, then using the "Shading Color" button) the text and the table.
Instead of the table cells filling with color, the text takes the background
color.

I then search for any occurrence of BackgroundPatternColor in:
+ selection.range
+ selection.formattedtext
+ selection.paragraphs

None of these seem to be it. What am I missing? Or is this a bug
somewhere? (search code below


Bad form, I know, replying to my own post. But I figured it out.

Selection.ParagraphFormat.Shading

Ah. Much better. I can sleep, now.

-j
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top