Style.UnhideWhenUsed Property (Word)
True if the specified style is hidden in the Styles gallery and in the Styles task pane in Microsoft Word until it is used in the document. Read/write.
Version Information
Version Added: Word 2010
Syntax
expression .UnhideWhenUsed
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 Visibilty 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. |
Note
For heading styles, if the Document.FormattingShowNextLevel property is set to True, this property setting is ignored. (In that case, each heading style is shown when the previous heading style is used).
Example
The following Visual Basic for Applications (VBA) code example creates a new style called “MyStyle” and marks it hidden until it is used.
Dim wrdStyle As Style
Set wrdStyle = ActiveDocument.Styles.Add("MyStyle", wdStyleTypeParagraph)
With wrdStyle
.Visibility = True
.UnhideWhenUsed = True
End With