BUG - Visibility Property


objStyleVisibility Property

This property actually does the opposite to what it says.
ActiveDocument.Styles("").Visibility = True 'will hide the style
ActiveDocument.Styles("").Visibility = False 'will show the style



objStyleVisibility Property

Although this property should not really be used it can be useful to hide and show a list of styles in the Styles and Formatting task pane.
However if you run either of the following lines of code all the heading styles in your document will have a list style associated with them

ActiveDocument.Styles("Article / Section").Visibility = False 
ActiveDocument.Styles("Article / Section").Visibility = True

The code can be used in conjunction with any of the following "select styles to show" options "Recommended, In Use, In Current Document"



© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrev