Paste Method
Applies To
Shapes collection object, Slides collection object, TextRange object, View object.
Description
Shapes object: Pastes the shapes, slides, or text on the Clipboard into the specified Shapes collection, at the top of the z-order. Each pasted object becomes a member of the specified Shapes collection. If the Clipboard contains entire slides, the slides will be pasted as shapes that contain the images of the slides. If the Clipboard contains a text range, the text will be pasted into a newly created TextFrame shape. Returns a ShapeRange object that represents the pasted objects.
Slides object: Pastes the slides on the Clipboard into the Slides collection for the presentation. Specify where you want to insert the slides with the Index argument. Returns a SlideRange object that represents the pasted objects. Each pasted slide becomes a member of the specified Slides collection.
TextRange object: Pastes the text on the Clipboard into the specified text range, and returns a TextRange object that represents the pasted text.
View object: Pastes the contents of the Clipboard into the active view. Attempting to paste an object into a view that won't accept it causes an error. For information about views and the objects you can paste into them, see the "Remarks" section.
Syntax 1
expression.Paste
Syntax 2
expression.Paste(Index)
expression Required. An expression that returns a Shapes, TextRange, or View object (Syntax 1) or a Slides object (Syntax 2).
Index Optional Long. The index number of the slide that the slides on the Clipboard are to be pasted before. If this argument is omitted, the slides on the Clipboard are pasted after the last slide in the presentation.
Remarks
Use the ViewType property to set the view for a window before pasting the Clipboard contents into it. The following table shows what you can paste into each view.
Into this view | You can paste the following from the Clipboard |
|
Slide view or notes page view | Shapes, text, or entire slides. If you paste a slide from the Clipboard, an image of the slide will be inserted onto the slide, master, or notes page as an embedded object. If one shape is selected, the pasted text will be appended to the shape's text; if text is selected, the pasted text will replace the selection; if anything else is selected, the pasted text will be placed in it's own text frame. Pasted shapes will be added to the top of the z-order and won't replace selected shapes. |
Outline view | Text or entire slides. You cannot paste shapes into outline view. A pasted slide will be inserted before the slide that contains the insertion point. |
Slide sorter view | Entire slides. You cannot paste shapes or text into slide sorter view. A pasted slide will be inserted at the insertion point or after the last slide selected in the presentation. |
See Also
Cut method.
Example
This example copies the selection in window one to the Clipboard and copies it into the view in window two. If the Clipboard contents cannot be pasted into the view in window two — for example, if you try to paste a shape into slide sorter view — this example fails.
Windows(1).Selection.Copy
Windows(2).View.Paste
This example copies the selection in window one to the Clipboard, makes sure that window one is in slide view, and then copies the Clipboard contents into the view in window two.
Windows(1).Selection.Copy
With Windows(2)
.ViewType = ppViewSlide
.View.Paste
End With
This example copies shape one on slide one in the active presentation to the Clipboard and then pastes it into slide two.
With ActivePresentation
.Slides(1).Shapes(1).Copy
.Slides(2).Shapes.Paste
End With
This example cuts the text in shape one on slide one in the active presentation, places it on the Clipboard, and then pastes it after the first word in shape two on the same slide.
With ActivePresentation.Slides(1)
.Shapes(1).TextFrame.TextRange.Cut
.Shapes(2).TextFrame.TextRange.Words(1).InsertAfter.Paste
End With
This example cuts slides three and five from the Old Sales presentation and then inserts them before slide four in the active presentation.
Presentations("Old Sales").Slides.Range(Array(3, 5)).Cut
ActivePresentation.Slides.Paste 4