Skip to content

Latest commit

 

History

History
71 lines (43 loc) · 1.7 KB

Project.shape.select.md

File metadata and controls

71 lines (43 loc) · 1.7 KB
title ms.service ms.assetid ms.date ms.localizationpriority
Shape.Select method (Project)
project-server
b96be944-9388-cecc-2c3f-ec25e9f96aec
06/08/2017
medium

Shape.Select method (Project)

Selects the shape.

Syntax

expression.Select (Replace)

expression A variable that represents a Shape object.

Parameters

Name Required/Optional Data type Description
Replace Optional Variant True replaces the current selection with the new selection. False adds the new selection to the current selection. The default value is True.
Replace Optional Variant

Return value

Nothing

Example

The following example creates three shapes, and then selects each shape. Because the second and third selections add to the first selection, all three shapes are selected (see Figure 1).

Sub SelectShapes()
    Dim theReport As Report
    Dim shp1 As shape
    Dim shp2 As shape
    Dim shp3 As shape
    Dim reportName As String
    
    reportName = "Select Report"
    
    Set theReport = ActiveProject.Reports.Add(reportName)
    Set shp1 = theReport.Shapes.AddShape(msoShapeActionButtonHelp, 20, 50, 20, 30)
    Set shp2 = theReport.Shapes.AddShape(msoShapeBalloon, 100, 50, 30, 50)
    Set shp3 = theReport.Shapes.AddShape(msoShapeWave, 140, 50, 30, 50)
            
    shp1.Select
    shp2.Select False
    shp3.Select False
End Sub

Figure 1. Using the Select method to add to a selection

Using the Select method to add a selection

See also

Shape Object

[!includeSupport and feedback]