InUse Property

Applies To

Style object.

Description

True if the specified style is a built-in style that has been modified or applied in the document or a new style that has been created in the document. Read-only Boolean.

Remarks

This property doesn't indicate whether the style is currently applied to any text in the document. For instance, if text that's been formatted with a style is deleted, the InUse property of the style remains True. For built-in styles that have never been used in the document, this property returns False.

See Also

BuiltIn property, NameLocal property.

Example

This example displays a message box that lists the names of all the styles that are currently being used in the active document.

Set mydoc = ActiveDocument
msg = "Styles in use:" & vbCr
For Each sty In mydoc.Styles
    If sty.InUse = True Then
        With mydoc.Content.find
            .ClearFormatting
            .Text = ""
            .Style = sty
            .Execute Format:=True
            If .Found = True Then
                msg = msg & sty & vbCr
            End If
        End With
    End If
Next sty
MsgBox msg