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

Shape.PickUp 方法 (项目)Shape.PickUp Method (Project)

office 365 dev account|上次更新日期: 2017/9/25
|
1 参与者

复制形状的格式。Copies the formatting of a shape.

语法Syntax

表达式装货expression. PickUp

表达式_一个表示一个Shape对象的变量。_expression A variable that represents a Shape object.

返回值Return value

执行任何操作Nothing

注解Remarks

使用Apply方法应用到另一个形状复制的格式。Use the Apply method to apply copied formatting to another shape.

示例Example

下面的示例创建两个圆柱形状、 颜色的第一个形状的红色、 复制的第一个形状的格式和将其应用到第二个形状。The following example creates two cylindrical shapes, colors the first shape red, copies the formatting of the first shape, and then applies it to the second shape.

Sub ApplyShapeFormat()
    Dim theReport As Report
    Dim shp1 As shape
    Dim shp2 As shape
    Dim reportName As String
    Dim sRange As ShapeRange

    reportName = "Apply Report"

    Set theReport = ActiveProject.Reports.Add(reportName)
    Set shp1 = theReport.Shapes.AddShape(msoShapeCan, 10, 30, 100, 100)
    shp1.Name = "Shape 1"
    shp1.Fill.ForeColor.RGB = &;H1010FF  ' Red color.

    Set shp2 = theReport.Shapes.AddShape(msoShapeCan, 30, 140, 100, 100)
    shp2.Name = "Shape 2"               ' Blue default color.

    With theReport
        .Shapes("Shape 1").PickUp
        .Shapes("Shape 2").Apply
    End With
End Sub

另请参阅See also

其他资源Other resources

形状对象应用方法ShapeRange.Pickup 方法Shape ObjectApply MethodShapeRange.Pickup Method

© 2018 Microsoft