Shape.Id Property
Returns a Long that identifies the shape or range of shapes. Read-only.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
ReadOnly Property Id As Integer
Get
'Usage
Dim instance As Shape
Dim value As Integer
value = instance.Id
int Id { get; }
Property Value
Type: System.Int32
Long
Examples
This example adds a new shape to the active presentation, then fills the shape according to the value of the Id property.
Sub ShapeID()
With ActivePresentation.Slides(1).Shapes.AddShape _
(Type:=msoShape5pointStar, Left:=100, _
Top:=100, Width:=100, Height:=100)
Select Case .IdCase 0 To 500
.Fill.ForeColor.RGB = RGB(Red:=255, Green:=0, Blue:=0)
Case 500 To 1000
.Fill.ForeColor.RGB = RGB(Red:=255, Green:=255, Blue:=0)
Case 1000 To 1500
.Fill.ForeColor.RGB = RGB(Red:=255, Green:=0, Blue:=255)
Case 1500 To 2000
.Fill.ForeColor.RGB = RGB(Red:=0, Green:=255, Blue:=0)
Case 2000 To 2500
.Fill.ForeColor.RGB = RGB(Red:=0, Green:=255, Blue:=255)
Case Else
.Fill.ForeColor.RGB = RGB(Red:=0, Green:=0, Blue:=255)
End Select
End With
End Sub