Object Model Reference : Classes : L : Layer : Properties : Layer.Properties |
Property Properties As Properties
Member of Layer
The Properties property returns the Properties collection, which lets you specify and manipulate the custom data that is associated with a given layer that belongs to a specified page only.
The Properties property returns a read-only value.
The following VBA example creates 100 shapes and stores their IDs in the active layer for future reference.
Sub CreateAndStoreShapes() |
Dim i As Long |
Dim x As Double, y As Double, r As Double |
Dim MaxX As Double, MaxY As Double, MaxR As Double |
Dim s As Shape, Num As Long |
MaxX = ActivePage.SizeWidth |
MaxY = ActivePage.SizeHeight |
MaxR = 1 |
Num = 100 |
ActiveLayer.Properties("ShapeArray", 0) = Num ' Store the total number of shapes |
For i = 1 To Num |
x = Rnd() * MaxX |
y = Rnd() * MaxY |
r = Rnd() * MaxR |
Set s = ActiveLayer.CreateEllipse2(x, y, r) |
s.Fill.UniformColor.RGBAssign Rnd() * 256, Rnd() * 256, Rnd() * 256 |
ActiveLayer.Properties("ShapeArray", i) = s.StaticID ' Store the current shape's ID number |
Next i |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.