Previous Document Next Document

Object Model Reference : Classes : D : Document : Properties : Document.Properties


Document.Properties

Property Properties As Properties

Description

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 CorelDRAW file and retrieved the next time the document is opened. Because 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.

VBA example

The following VBA 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 Properties.Delete or Properties.DeleteByIndex methods.

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.