Previous Document Next Document

Object Model Reference : Classes : P : Properties : Properties : Properties.Item


Properties.Item

Property Item(Name As String, ID As Long) As Variant

Description

Member of Properties

The Item property returns the data item specified by the data name and ID. It can also be used to assign data to an object.

Item is the default property of the Properties class.

Parameter
Description
Name
Specifies the data item by its name
ID
Specifies the data item by its ID

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.