AnnSelect example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

This example for the AnnSelect event displays a message box showing the number of selected annotation objects. It then goes through the array of selected objects to see if any of them are polygons.

Private Sub Lead1_AnnSelect(ByVal aObjects As Variant, ByVal uCount As Integer)
   Dim nType As Integer
   Dim x As Integer
   Dim bSelected As Boolean

   bSelected = False
   MsgBox CStr(uCount) & " objects were selected"
   For x = 1 To uCount
     nType = Lead1.AnnGetType(aObjects(x - 1))
     If nType = ANNOBJECT_POLYGON Then
         bSelected = True
     End If
   Next

   If bSelected <> True Then
     MsgBox "No Polygon Objects were selected"
   End If
End Sub