Skip to content

Latest commit

 

History

History
68 lines (43 loc) · 1.53 KB

Project.shape.pickup.md

File metadata and controls

68 lines (43 loc) · 1.53 KB
title ms.service ms.assetid ms.date ms.localizationpriority
Shape.PickUp method (Project)
project-server
954390b6-8992-f239-d891-467ec732b0b0
06/08/2017
medium

Shape.PickUp method (Project)

Copies the formatting of a shape.

Syntax

expression.PickUp

expression A variable that represents a Shape object.

Return value

Nothing

Remarks

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

Shape Object Apply Method ShapeRange.Pickup Method

[!includeSupport and feedback]