RemoveAll Method Example

The following example removes all the lines of code from the Click event of the object Rect2 in the active document.

Dim o As Object

Dim oProc As Object

Dim lIndex As Long

Dim lFound As Long

Set o = Application.ActiveDocument.Page.FindObject("Rect2")

o.Procedures.GetEventHandlerIndex "Click", lIndex, lFound

If (lFound) Then

Set oProc = o.Procedures.Item(lIndex)

oProc.Lines.RemoveAll

End If