GefRange.Remove (method)

Removes the specified item from the collection.
Syntax: object.Remove IndexOrName
Parameters:
Optional IndexOrName As VARIANT -
Description: The intIndex argument can range from 0 to Count-1.

The GefRange collection support access by index number or name. For the GefRange collection, the object is simply removed from the collection but it continues to exist in the screen (in a GefObjects collection).

Example:

Sub Range_Remove()
    
    Dim oCimScr As GefScreen
    Dim oCimObjGrp As GefObject
    Dim oCimRnge As GefRange
    Dim i As Integer
    
    Set oCimScr = CimGetScreen
    Set oCimObjGrp = oCimScr.Object.Objects.Item("Group1")
    Set oCimRnge = oCimObjGrp.Ungroup
    
    For i = 0 To oCimRnge.Count - 1
        oCimRnge.Remove i
        MsgBox oCimRnge.Item(i).Name & _
            " was removed from the selection"
    Next i
    
End Sub