View Single Post
 
Old 08-10-2022, 04:12 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This might get you started - select a paragraph and run the macro to remove the shading from paragraphs with that same colour.
Note: Your results might vary according to how the colours are applied. In my quick testing the macro was greedy and removed colours from other paragraphs that were coloured from the same row of the colour palette (ie same tint level). It worked fine if the colours came from other levels of tint or were defined in RGB.
Code:
Sub Macro2()
  Dim iCol As Long
  iCol = Selection.Shading.BackgroundPatternColor
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .ParagraphFormat.Shading.BackgroundPatternColor = iCol
    .Replacement.ParagraphFormat.Shading.BackgroundPatternColorIndex = wdWhite
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote