Share via


ShapeRange.Duplicate Method

Publisher Developer ReferencePublisher Developer Reference

Creates a duplicate of the specified Shape or ShapeRange object, adds the new shape or range of shapes to the Shapes collection immediately after the shape or range of shapes specified originally, and then returns the new Shape or ShapeRange object.

Syntax

expression.Duplicate

expression   A variable that represents a ShapeRange object.

Return Value
ShapeRange

Example

This example adds a new, blank page at the end of the active publication, adds a diamond shape to the new page, 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 first accent color for the active color scheme.

Visual Basic for Applications
  Dim pgTemp As Page
Dim shpTemp As Shape

Set pgTemp = ActiveDocument.Pages.Add(Count:=1, After:=1) Set shpTemp = pgTemp.Shapes _ .AddShape(Type:=msoShapeDiamond, _ Left:=10, Top:=10, Width:=250, Height:=350)

With shpTemp.Duplicate .Left = 150 .Fill.ForeColor.SchemeColor = pbSchemeColorAccent1 End With

See Also