Skip to content

Latest commit

 

History

History
65 lines (39 loc) · 1.26 KB

Word.Range.Paste.md

File metadata and controls

65 lines (39 loc) · 1.26 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.Paste method (Word)
vbawd10.chm157155449
vbawd10.chm157155449
Word.Range.Paste
06621016-de31-c61b-a9d0-6544b2d7e0a4
06/08/2017
medium

Range.Paste method (Word)

Inserts the contents of the Clipboard at the specified range.

Syntax

expression.Paste

expression Required. A variable that represents a Range object.

Remarks

If you don't want to replace the contents of the range, use the Collapse method before using this method.

When you use this method with a Range object, the range expands to include the contents of the Clipboard.

Example

This example copies and pastes the first table in the active document into a new document.

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

This example copies the selection and pastes it at the end of the document.

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

See also

Range Object

[!includeSupport and feedback]