Count

<< Click to Display Table of Contents >>

 

Count

Number Returns the number of child objects, or items, an object contains. This property works together with the Item method. If the object does not have any child objects, the returned value is 0 (zero). This is a read-only property. The next script contains an example of using this property.

Sub Screen1_Click()
  ' Searches all Screen objects and sets
  ' the ForegroundColor property to red
  Dim obj
  For i = 1 To Count
    Set obj = Item(i) ' Gets a child object
    obj.ForegroundColor = RGB(255, 0, 0)
  Next
End Sub

Was this page useful?