Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-02-2021, 05:07 PM
Guessed's Avatar
Guessed Guessed is offline Cannot access new table style Windows 10 Cannot access new table style 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

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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Table Style from Table 5 Onwards. mc1903 Word VBA 1 01-08-2021 08:36 AM
Cannot access new table style Want to copy & paste a table underneath itself x no. of time, table found through style heading name fly545 Word VBA 11 01-16-2020 05:53 PM
Cannot access new table style Apply Table Style without Table functions? dylansmith Excel 4 04-03-2017 10:53 AM
Cannot access new table style Table style of pasted table ChrisFManchester Word Tables 2 07-05-2015 06:17 AM
Cannot access new table style how to apply table style WITHOUT setting it as a table? dylansmith Excel 9 05-16-2014 07:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft