![]() |
![]() |
Document.Properties
Property Properties As Properties
Member of Document
The Properties property returns a Properties object that is used to store any custom data with the document.
The data is saved in the CDR file and retrieved the next time the document is opened. Since the data is persistent, you can use it to store global macro settings in the document. The data is available for VBA macros only and is not accessible in any way from the user interface of CorelDRAW.
The Properties property returns a read-only value.
The following code example creates three different custom property records in the current document and then retrieves their values. The values are saved along with the document and be available in the next session unless you delete them by using the Delete or DeleteByIndex methods of the Properties object.
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.