Paste 方法

       

将剪贴板上的内容插入指定的区域或选定区域。如果不需要替换区域或选定区域的内容,可在用本方法之前先用 Collapse 方法。

expression.Paste

expression   必需。该表达式返回一个 RangeSelection 对象。

说明

如果本方法用于区域对象,则将扩展该区域,使其包含剪贴板中的内容。如果本方法用于选定对象,则不会扩展所选内容,而是将所选内容置于已粘贴的剪贴板内容之后。

示例

本示例复制活动文档中第一个表格,并将其粘贴至新文档。

If ActiveDocument.Tables.Count >= 1 Then
    ActiveDocument.Tables(1).Range.Copy
    Documents.Add.Content.Paste
End If

本示例复制文档的第一段并将其粘贴至插入点。

ActiveDocument.Paragraphs(1).Range.Copy
Selection.Collapse Direction:=wdCollapseStart
Selection.Paste

本示例复制所选内容并将其粘贴到文档结尾。

If Selection.Type <> wdSelectionIP Then
    Selection.Copy
    Set Range2 = ActiveDocument.Content
    Range2.Collapse Direction:=wdCollapseEnd
    Range2.Paste
End If