Collection Methods

An object within the collection is returned via the Item method.

 

    Dim sName As String

 

    'Get the name of the 1st Surface

    sName = msApp.Design.Surfaces.Item(1).Name

   

    MsgBox sName

 

The above code returns the name of the first surface in the design. All of the surface and marker properties can be accessed through the Item property of their relevant Collection object.

 

The Surfaces collection object has a method for adding new items to the design. A new surface is added to the design using the Add method of the Surfaces collection. The Add method for the surfaces collection has been used already in this manual in the tutorial on page 28