Object Model Reference : Classes : L : Layers : Properties : Layers.Item |
Property Item(IndexOrName As Variant) As Layer
Member of Layers
The Item property returns the layer associated with a specified index number. It is the default property of the Layers class.
You can access layers by their index number or name.
The Item property returns a read-only value.
The following VBA example creates a rectangle on the topmost layer of the first page of the active document, and it also creates a horizontal line on the Guides layer.
Sub Test() |
Dim d As Document |
Dim p As Page |
Set d = ActiveDocument |
Set p = d.Pages(1) |
p.Layers(1).CreateRectangle 0, 0, 3, 3 |
d.Pages(0).Layers("Guides").CreateLineSegment 0, 4, 5, 4 |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.