Name property (Shape)

Returns or sets the name of the Shape object. Shape names are used for automation only. Default is "". Read/write String.

Applies to

Objects:  Shape

Syntax

object.Name

Parameters

Part Description
object Required. An expression that returns a Shape object.

Example

    Sub SetShapeName()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map   Dim objLoc As MapPoint.Location
  'Set up application and get a Location object   Set objMap = objApp.ActiveMap   objApp.Visible = True   objApp.UserControl = True   Set objLoc = objApp.ActiveMap.GetLocation(0, 0)
  'Create a shape at this location, then zoom to this location   Set objMap.Location = objLoc   objMap.Shapes.AddShape geoShapeOval, objLoc, 20, 30
  'Set the name of the shape, then get it   objMap.Shapes.Item(1).Name = "My Oval"   MsgBox "Name of shape: " + objMap.Shapes.Item(1).Name
  End Sub