The IndexOf method returns the index number of a specified shape in a shape range. If the shape is not in the range, 0 is returned.
Examples:
The following VBA example determines whether the selected shape is a curve residing on the active layer of the document.
Sub Test()
Dim sr As ShapeRange
Set sr = ActiveLayer.FindShapes(, cdrCurveShape)
If sr.IndexOf(ActiveShape) = 0 Then
MsgBox "The selected shape is not a curve residing on the current layer"
End If
End Sub