InsertParagraphBefore 方法 (Word)Selection.InsertParagraphBefore method (Word)

在指定的所选内容或范围前插入一个新段落。Inserts a new paragraph before the specified selection or range.

语法Syntax

expression.expression. InsertParagraphBefore

_表达式_是必需的。expression Required. 表示 Selection 对象的变量。A variable that represents a Selection object.

备注Remarks

使用此方法后,所选内容将扩展以包含新段落。After using this method, the selection expands to include the new paragraph.

示例Example

以下示例在所选内容之前插入文字“Hello”作为一个新段落。This example inserts the text "Hello" as a new paragraph before the selection.

With Selection 
 .InsertParagraphBefore 
 .InsertBefore "Hello" 
End With

另请参阅See also

Selection 对象Selection Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.