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

用新段落替换指定的所选内容。Replaces the specified selection with a new paragraph.

语法Syntax

expression.expression. InsertParagraph

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

备注Remarks

使用方法后,所选内容包含新段落。After using method, the selection contains the new paragraph. 如果不想替换当前所选内容, 请在使用此方法之前使用Collapse方法。If you don't want to replace the current selection, use the Collapse method before using this method. 您可以使用 InsertParagraphBeforeInsertParagraphAfter 方法来之前或所选内容之后插入一个新段落。You can also use the InsertParagraphBefore or InsertParagraphAfter method to insert a new paragraph before or after a selection.

示例Example

以下示例折叠所选内容,然后在插入点插入段落标记。This example collapses the selection and then inserts a paragraph mark at the insertion point.

With Selection 
 .Collapse Direction:=wdCollapseStart 
 .InsertParagraph 
 .Collapse Direction:=wdCollapseEnd 
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.