EdLimitItem(vIndex As Variant) As EdLimit


vIndex As Variant
The limit can be selected via a number (counting starts at 0) or via a string (name of the limit).
not used


This method returns an "EdLimit" object from a variable.


Sub EDLimitItem()

Dim zVariables As Variables 'Object from type Variables
Dim zVariable As Variable 'Child object from type Variables
Dim zDrivers As Drivers 'Object from type Drivers
Dim zVarTypes As VarTypes 'Object from type VarTypes
Dim zEdLimit As EdLimit 'Object from type EdLimit
Dim i As Integer

'Fill the objects
Set zVariables = MyWorkspace.ActiveDocument.Variables
Set zDrivers = MyWorkspace.ActiveDocument.Drivers
Set zVarTypes = MyWorkspace.ActiveDocument.VarTypes

'Create a "intern driver" variable called "TestVariable" with object type "internal variable" and datatype "INT"
Set zVariable = zVariables.CreateVar("TestVariable", zDrivers.Item(0), 33, zVarTypes.Item("INT"))
'Create 5 editor limits at the "TestVariable"
For i = 0 To 4
Next i

'Select the first limit of the variable
Set zEdLimit = zVariable.EDLimitItem(0)
'Set the limit active
zEdLimit.Active = True
'Set limit text
zEdLimit.Text = "Limit reached"
'Set limit value to 10
zEdLimit.LimitValue = 10
'Set the limit as maximum
zEdLimit.IsMax = True
'Set the limit as alarm
zEdLimit.Alarm = True
'Limit should be recognized in the CEL
zEdLimit.Cel = True

End Sub

See Also

Variable, EdLimit