How to traverse line in dawingdoc

follow code, can be delete text with traverse method.

Function delTxtLayer(SwDraw As DrawingDoc, Layer)

    Dim SwView As View

        Set SwView = SwDraw.GetFirstView

    Dim SwNote As Note, SwAnn As Annotation

        Set SwNote = SwView.GetFirstNote

        Do While Not SwNote Is Nothing

            Set SwAnn = SwNote.GetAnnotation

            ''Debug.Print SwNote.GetText, SwAnn.Layer

            If SwAnn.Layer = Layer Then

                SwAnn.Select True

            End If

            Set SwNote = SwNote.GetNext

        Loop

        SwDraw.EditDelete

End Function

Help me.

  How to traverse line in drawingdoc. delte line in drawingdoc.

SolidworksApi macros