Skip to content

Latest commit

 

History

History
67 lines (43 loc) · 1.68 KB

Project.shaperange.apply.md

File metadata and controls

67 lines (43 loc) · 1.68 KB
title ms.service ms.assetid ms.date ms.localizationpriority
ShapeRange.Apply method (Project)
project-server
5b100f4a-99a0-77f2-772a-203b2f836293
06/08/2017
medium

ShapeRange.Apply method (Project)

Applies formatting to a shape range, where the formatting information has been copied by using the PickUp method.

Syntax

expression.Apply

expression A variable that represents a 'ShapeRange' object.

Return value

Nothing

Example

The following example creates three cylindrical shapes, colors the first shape red, adds the second and third shapes to a shape range, copies the formatting of the first shape, and then applies the formatting to the shape range.

Sub ApplyShapeFormat()
    Dim theReport As Report
    Dim shp1 As shape
    Dim shp2 As shape
    Dim shp3 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.
    
    ' Blue default color.
    Set shp2 = theReport.Shapes.AddShape(msoShapeCan, 30, 140, 100, 100)
    
    ' Blue default color.
    Set shp3 = theReport.Shapes.AddShape(msoShapeCan, 140, 140, 100, 100)
    
    Set sRange = theReport.Shapes.Range(Array(2, 3))
    
    theReport.Shapes("Shape 1").PickUp
    sRange.Apply
End Sub

See also

ShapeRange Object PickUp Method Shape.Apply Method

[!includeSupport and feedback]