Previous Document Next Document

Object Model Reference : Classes : L : Layer : Properties : Layer.MasterProperties


Layer.MasterProperties

Property MasterProperties As Properties

Description

Member of Layer

The MasterProperties property returns the Properties collection, which allows you to specify and manipulate custom data for a given layer on all pages of the document.

The MasterProperties property returns a read-only value.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.