View Single Post
 
Old 06-16-2014, 08:04 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your four macros are equivalent to:
Code:
Sub Colorize()
With ActiveDocument
  With .Background.Fill
    .ForeColor.TintAndShade = 0
    .Visible = msoTrue
    .Solid
  End With
  Select Case .Range.Font.ColorIndex
    Case wdWhite
      Select Case .Background.Fill.ForeColor.RGB
        Case RGB(0, 0, 255)  'Blue
          .Background.Fill.ForeColor.RGB = RGB(0, 0, 0) 'Black
        Case RGB(0, 0, 0)  'Black
          .Range.Font.ColorIndex = wdAuto
          .Background.Fill.ForeColor.RGB = RGB(255, 255, 255) 'White
      End Select
    Case wdAuto, wdBlack
      Select Case .Background.Fill.ForeColor.RGB
        Case RGB(255, 255, 255) 'White
          .Background.Fill.ForeColor.RGB = RGB(255, 255, 0) 'Yellow
        Case RGB(255, 255, 0) 'Yellow
          .Range.Font.ColorIndex = wdWhite
          .Background.Fill.ForeColor.RGB = RGB(0, 0, 255) 'Blue
        End Select
  End Select
End With
End Sub
It seems, though, that you only want two font colours, not three, and four different backgrounds, not three.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote