I can cycle it on/off but can't figure out how to "reset" it. Once a color shape is deleted the doc palette still shows the color until you click thru and hit reset.
Sub RefreshDocPalette() ActiveDocument.Palette.Close
ActiveDocument.Palette.Open
End Sub
P.s. why after hitting "reset palette" does it add a black swatch even though there's no black used in the doc.
For i = ActiveDocument.Palette.Colors.Count To 1 Step -1 ActiveDocument.Palette.RemoveColor (i)Next i
that removes all colors. I just want to remove the color that's not used anywhere.
this one was offered to try but throws an error and still isn't right (see next post)
Sub RefreshDocPalette2()Dim c As Color, sr As New ShapeRange, srAllShapes As ShapeRange, s As Shape Set srAllShapes = ActivePage.Shapes.All For Each c In ActiveDocument.Palette.Colors For Each s In srAllShapes If s.Fill.Type = cdrUniformFill Then If c.IsSame(s.Fill.UniformColor) Then sr.Add s End If Next s If sr.Count > 0 Then srAllShapes.RemoveRange sr: sr.RemoveAll Else With ActiveDocument.Palette .RemoveColor .GetIndexOfColor(c) End With End If Next cEnd Sub