Previous Document Next Document

Object Model Reference : Classes : L : Layers : Properties : Layers.Item


Layers.Item

Property Item(IndexOrName As Variant) As Layer

Description

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.

Parameter
Description
IndexOrName
Specifies the layer by its index number or name:
 
Index — Specifies the preset placeholder that uniquely identifies each member of the Layers collection
 
Name — Specifies the string that uniquely identifies each layer

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.