![]() |
![]() |
Properties.Item
Property Item(Name As String, ID As Long) As Variant
Member of Properties
The Item property returns the data item specified by the data name and ID.
The Item property can also be used to assign data to an object.
The Item property of the Properties collection is the default property and its reference can be omitted when accessing an item in the collection. For example, Properties.Item(MyMacroName, 5)
is the same as Properties(MyMacroName, 5)
they both reference the fifth property in the collection.
Parameters
|
Description
|
Name
|
Represents a string value that uniquely identifies a property
|
ID
|
Represents a unique identifier of a property within CorelDRAW
|
The following code example creates three different custom property records in the current document and retrieves their values. The values are saved along with the document and made available in the next session unless you delete them by using Delete or DeleteByIndex method.
Sub Test() Const MyMacroName As String = "MyTestMacro" With ActiveDocument .Properties(MyMacroName, 1) = "My String 1" ' String .Properties(MyMacroName, 2) = 1 ' Integer .Properties(MyMacroName, 3) = Atn(1) * 4 ' Double MsgBox .Properties(MyMacroName, 1) MsgBox .Properties(MyMacroName, 2) MsgBox .Properties(MyMacroName, 3) End With End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.