Table of contents
Collapse the table of content
Expand the table of content

ShapeRange.Value Property (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Gets an individual Shape object in the ShapeRange collection. Read-only Shape.


expression. Value

expression A variable that represents a ShapeRange object.


Value is the default property for a ShapeRange object.


The following example creates a report named "Test Report", creates two shapes, and then adds the shapes to a ShapeRange object. The statement that begins with sRange.Value(1) gets the first shape in the shape range. The statement that begins with sRange(2) invokes the default Value property and gets the second shape in the shape range.

Sub TestShapeRangeValue()
    Dim theReport As Report
    Dim textShape1 As shape
    Dim textShape2 As shape
    Dim reportName As String
    Dim sRange As ShapeRange

    reportName = "Test Report"

    Set theReport = ActiveProject.Reports.Add(reportName)
    Set textShape1 = theReport.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 50, 350, 80)
    textShape1.Name = "Text box 1"

    Set textShape2 = theReport.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 130, 350, 80)
    textShape2.Name = "Text box 2"

    Set sRange = theReport.Shapes.Range(Array("Text box 1", "Text box 2"))

    sRange.TextFrame2.AutoSize = msoAutoSizeShapeToFitText

    sRange.Value(1).TextFrame2.TextRange.Text = "This is a test. It is only a test."
    sRange(2).TextFrame2.TextRange.Text = "This is text box 2."
End Sub

Property value


See also

Other resources

ShapeRange ObjectShape Object

© 2018 Microsoft