Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.52 KB

Publisher.ShapeRange.Duplicate.md

File metadata and controls

50 lines (33 loc) · 1.52 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ShapeRange.Duplicate method (Publisher)
vbapb10.chm2293780
vbapb10.chm2293780
Publisher.ShapeRange.Duplicate
e940e551-4307-aa33-5713-80f77fade8af
06/14/2019
medium

ShapeRange.Duplicate method (Publisher)

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.

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

[!includeSupport and feedback]