Returns the specified layer object.
Set variable = object.Item ( index ) |
- Index
- Required. A Variant that specifies the name or index of the layer.
index is a variant specifying the layer to reference. It can be either the index or the name of the layer as shown in the Table of Contents dialog box. For example, if your map contains a layer named "Soildata" that has an index of 2, the following two lines of code will yield the same result:
Set theLayer = Application.Map.Layers.Item(2)
Set theLayer = Application.Map.Layers.Item("Soildata")
The Item method is the default method for the Layers collection. Therefore, the following two lines of code will yield the same result:
Set theLayer = Application.Map.Layers.Item("Soildata")
Set theLayer = Application.Map.Layers("Soildata")
Set theLayer = Application.Map.Layers.Item(2)
Set theLayer = Application.Map.Layers.Item("Soildata")
The Item method is the default method for the Layers collection. Therefore, the following two lines of code will yield the same result:
Set theLayer = Application.Map.Layers.Item("Soildata")
Set theLayer = Application.Map.Layers("Soildata")