Share via


Paragraph.IsStyleSeparator Property

Word Developer Reference

True if a paragraph contains a special hidden paragraph mark that allows Microsoft Word to appear to join paragraphs of different paragraph styles. Read-only Boolean.

Syntax

expression.IsStyleSeparator

expression   An expression that returns a Paragraph object.

Example

This example formats all paragraphs in which there is a style separator with the built-in "Normal" style.

Visual Basic for Applications
  Sub StyleSep()
    Dim pghDoc As Paragraph
    For Each pghDoc In ActiveDocument.Paragraphs
        If pghDoc.IsStyleSeparator = True Then
            pghDoc.Range.Select
            Selection.Style = "Normal"
        End If
    Next pghDoc
End Sub

This example adds a paragraph after each style separator and then deletes the style separator.

Visual Basic for Applications
  Sub RemoveStyleSeparator()
    Dim pghDoc As Paragraph
    Dim styName As String
'Loop through all paragraphs in document to check if it is a style
'separator. If it is, delete it and enter a regular paragraph
For Each pghDoc In ActiveDocument.Paragraphs
    If pghDoc.<strong class="bterm">IsStyleSeparator</strong> = True Then
        pghDoc.Range.Select
        With Selection
            .Collapse (wdCollapseEnd)
            .TypeParagraph
            .MoveLeft (1)
            .TypeBackspace
        End With
    End If
Next pghDoc

End Sub

See Also