Shapes.Paste 方法 (PowerPoint)

将剪贴板上的形状、幻灯片或文本粘贴到 z 顺序顶部的指定 Shapes 集合中。 粘贴的每个对象都会成为指定的 Shapes 集合的成员。 如果剪贴板包含全部幻灯片,则这些幻灯片将作为包含幻灯片图像的形状粘贴。 如果剪贴板包含文本范围,则该文本将被粘贴到一个新创建的 TextFrame 形状中。 返回一个代表粘贴的对象的 ShapeRange 对象。

语法

表达式粘贴

expression:一个表示 Shapes 对象的变量。

返回值

ShapeRange

备注

将剪贴板内容粘贴到窗口中之前,请使用 ViewType 属性设置窗口视图。 下表显示了可以粘贴到每个视图中的内容。

视图 可以从剪贴板中粘贴以下内容
幻灯片视图或备注页视图 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 is own text frame. Pasted shapes will be added to the top of the z-order and won't replace selected shapes.
大纲视图 文本或整张幻灯片。 不能向大纲视图粘贴形状。 粘贴的幻灯片将被插到光标所在的幻灯片之前。
幻灯片浏览视图 整张幻灯片。 不能向幻灯片浏览视图粘贴形状或文本。 粘贴的幻灯片将被插到光标处或演示文稿中最后选中的一张幻灯片之后。

如果未完全下载源内容,此方法将失败并发生错误。 有关分部文档的详细信息,请参阅 使用分部文档

示例

本示例将活动演示文稿第一张幻灯片的第一个形状复制到剪贴板中,然后将其粘贴到第二张幻灯片中。

With ActivePresentation

    .Slides(1).Shapes(1).Copy

    .Slides(2).Shapes.Paste

End With

本示例剪切活动演示文稿第一张幻灯片第一个形状的文本,将其放到剪贴板,然后将其粘贴到同一幻灯片第二个形状第一个字之后。

With ActivePresentation.Slides(1)

    .Shapes(1).TextFrame.TextRange.Cut

    .Shapes(2).TextFrame.TextRange.Words(1).InsertAfter.Paste

End With

另请参阅

Shapes 对象

使用部分文档

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。