Share via


Shape.Duplicate Method

Creates a duplicate of the specified Shape object, adds the new shape to the Shapes collection, and then returns a new ShapeRange object. The duplicated objects are placed at the end of the Shapes collection.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Function Duplicate As ShapeRange
'Usage
Dim instance As Shape
Dim returnValue As ShapeRange

returnValue = instance.Duplicate()
ShapeRange Duplicate()

Return Value

Type: Microsoft.Office.Interop.PowerPoint.ShapeRange
ShapeRange

Examples

This example adds a new, blank slide at the end of the active presentation, adds a diamond shape to the new slide, duplicates the diamond, and then sets properties for the duplicate. The first diamond will have the default fill color for the active color scheme; the second diamond will be offset from the first one and will have the default shadow color.

Set mySlides = ActivePresentation.Slides

Set newSlide = mySlides.Add(mySlides.Count + 1, ppLayoutBlank)

Set firstObj = newSlide.Shapes _

    .AddShape(msoShapeDiamond, 10, 10, 250, 350)

With firstObj.Duplicate.Left = 150

    .Fill.ForeColor.SchemeColor = ppShadow

End With

See Also

Reference

Shape Interface

Shape Members

Microsoft.Office.Interop.PowerPoint Namespace