Style.Visibility Property (Word)
True if the specified style should be hidden in the Styles gallery and in the Styles task pane. Read/write.
Version Information
Version Added: Word 2010
Syntax
expression .Visibility
expression An expression that returns a Style object.
Remarks
To determine the final state of the style, combine the state of this property with that of the UnhideWhenUsed property, as shown in the following table.
.Visibility = True |
.Visibilty = False |
|
---|---|---|
.UnhideWhenUsed = True |
Style is hidden until used. |
Style is visible (but marked as hidden until used). |
.UnhideWhenUsed = False |
Style is always hidden. |
Style is visible. |
Example
The following Visual Basic for Applications (VBA) code example creates a new style called “MyStyle” and marks it as always hidden.
Dim wrdStyle As Style
Set wrdStyle = ActiveDocument.Styles.Add("MyStyle", wdStyleTypeParagraph)
With wrdStyle
.Visibility = True
.UnhideWhenUsed = False
End With