View Single Post
 
Old 06-02-2021, 05:07 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

Words stylenames can be hidden from view quite easily so it is possible to have a style in the document which doesn't appear in the list because it is hidden. Normally, you go into Manage Styles to set the visibility but Table Styles can have this setting disabled for some reason that I don't understand.

Fortunately, vba comes to the rescue. This macro hides EVERY built-in table style (apart from one) and shows all the custom ones. I recommend you hide all of the built-in styles and then selectively show the few that you do want.
Code:
Sub HideMostTableStyles()
  Dim sty As Style
  For Each sty In ActiveDocument.Styles
    If sty.Type = wdStyleTypeTable Then
      Debug.Print sty.NameLocal, sty.BuiltIn
      sty.Visibility = sty.BuiltIn      'only the custom names are visible
    End If
  Next sty
  ActiveDocument.Styles("Table Grid").Visibility = False  'in magical Microsoft-land Visibility=False means you can see it
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote