Table of contents
TOC
折叠目录
展开目录

Shape.Duplicate 方法 (发布服务器)Shape.Duplicate Method (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
3 参与人员

创建指定的形状ShapeRange对象的一个副本,然后返回新的形状并添加新形状的形状与紧随其后的形状的Shapes集合范围或最初指定的形状范围绘图对象。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 变量。_expression_A variable that represents a Shape object.

返回值Return Value

ShapeShape

示例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
© 2018 Microsoft