Does anyone know how to use Find and Replace on an empty cell to change the style?
I suspect that this has some relationship to this thread on searching for styles in tables, but has anyone seen a way to replace the style of an empty cell without cycling through all the cells?
Your classic replace style macro, e.g.
With ChangeDocument.Content.Find .ClearFormatting .Style = OldStyle .Replacement.ClearFormatting .Replacement.Style = NewStyle .Execute Format:=True, findtext:="", replacewith:="", Replace:=wdReplaceAll End With
doesn’t change a table cell that’s got nothing in it.
My clients are asking to be able to remove ‘foreign’ styles from their documents, so this is critical.
What’s truly nasty is that if you then delete the ‘foreign’ style while it’s still attached to those cells, rather than them reverting to “Normal” as a paragraph would, there’s no style object attached to those ranges/cells/paragraphs at all! This gets even worse when, in trying to fix it (by looking for no style object on a paragraph), you can’t force a style to the ‘paragraph’ that is the end-of-row marker.