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.
I don't know if it was ever mentioned in this thread, but I stumbled across something today that might be relevant to the discussion.
There is a Document.AddColorsToDocPalette method.
That can add all the colors in the document, or just the colors in the current selection.
So, using NudeFan's code for removing the colors, then using this to add all of the colors in the document:
Sub reset_doc_palette() Dim i As Long For i = ActiveDocument.Palette.Colors.Count To 1 Step -1 ActiveDocument.Palette.RemoveColor (i) Next i ActiveDocument.AddColorsToDocPalette End Sub