Paragraph.IsStyleSeparator 属性 (Word)

如此 如果段落包含特殊的隐藏,则 Microsoft Word 可以显示要加入的另一种段落样式的段落的段落标记。 只读 Boolean

语法

expressionIsStyleSeparator

表达 返回“Paragraph”对象的表达式。

示例

本示例为包含内置"Normal"样式的样式分隔符的所有段落设置格式。

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

本示例在每个样式分隔符后添加一个段落,然后删除样式分隔符。

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.IsStyleSeparator = True Then 
 pghDoc.Range.Select 
 With Selection 
 .Collapse (wdCollapseEnd) 
 .TypeParagraph 
 .MoveLeft (1) 
 .TypeBackspace 
 End With 
 End If 
 Next pghDoc 
End Sub

另请参阅

段落对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。